Gossamer Forum
Home : Products : DBMan : Installation :

Can I use -gt and -lt used in select fields?

Quote Reply
Can I use -gt and -lt used in select fields?
Okay I read the readme on this but it referred to only input text boxes but I want to do it off select fields. 1.) is this possible (i think so but that doesn't mean that much) and 2.) where do I put those 3 important characters? I did this:
<TD ALIGN="center" HEIGHT="36" WIDTH="75%"> |; print &build_select_field ("year", "$rec{'year-gt'}"); print qq| &nbsp TO &nbsp |; print &build_select_field ("year", "$rec{'year-lt'}"); print qq|</TD>
I don't get any errors but I don't get any searches either Frown DO I have to make like a year2 variable?

I got this far (with, of course JP's help) , AND I'M going to go farther-- Thanks JP
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
You'll need to define your select fields in your .cfg file as

year-gt => ....
year-lt => ....

Then, when you print them, use

print &build_select_field ("year-gt","$rec{'year-gt'}");

print &build_select_field ("year-lt","$rec{'year-lt'}");



------------------
JPD


Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Thanks JP!!!
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
umm, well thanks for the help but now I'm getting errors in printing the select fields. It's trying to tell me that I didn't configure them. Well, I've checked and double checked everthing seems to be kosher. anything that I should look for or change specifically in the config setup to do this?
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Hmmmmmm.

The only thing I can think of would be that your definition of the select fields is incorrect. I'd have to look at your .cfg file to have any idea.


------------------
JPD


Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Okay JP, it's in
http://www.comco.ne.jp/~carsten/dbman/default.txt
If I make any changes tonight I'll keep posting them and or post here for a success. Thanks.
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
I got "File Not Found" when I tried to access it. Maybe that means you got it fixed(?).


------------------
JPD


Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
DAHHHH, this was really stupid of me. I totally forgot that I'm must use my new address which uses the funky www2 scheming system. Sorry JP. One more time it's at:

http://www2.comco.ne.jp/~carsten/dbman/defalut.txt

No, I still for the life of me figure out what I'm doing wrong on top my eyes are spinning from looking at the screen too long today. I'd really appreciate it if you could take a look again. Thanks.
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
In spite of your typo in the second URL Smile I found it!

Have you had success before with adding comment lines within the field definitions? I know it helps to keep things straight, but it might cause problems. Maybe not, though.

You do not need -- in fact you definitely do not want -- -gt and -lt fields within your field definitions. Take out the fields "year-gt" and "year-lt." Also "pricevalue-gt" and "pricevalue-lt." Your "year" and "pricevalue" fields are going to have to be field type "numer." (You need to change the "year" field.)

Hmmmmm. You're using the font that gives Japanese characters, right? This is going to be a problem. The characters sort differently, so your results won't work. (It should be fine for anything that is an "alpha" field, but if you are sorting by numbers, you need to have just numbers in the field.)

Leave in the select field definitions for "year-gt," "year-lt," "pricevalue-gt" and "pricevalue-lt." It's okay to have them defined as select fields even though they aren't in the field definitions. When you use the build_select_field subroutine, it just looks for select fields that have been defined as select fields.

Make these changes and see what happens. If you're still having problems, let me know.


------------------
JPD


Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
JP,
I went ahead and followed your advice. I cleaned up my config file (erased all the comments and -gt, -lt variables) changed the year and pricevalue so that they are only numbers (the H1 H2 are a special year system in Japan -- they use both the Western 199? system and their own Japanese era (well, emperor'ed) system. but, I still get the can't build due to non-configured select fields. Jeez, I really don't know why? I see them before my eyes but DBMAN just spits them out. I reupped my default and html files (in html.pl I have the select fields only half -gt and -lt as a reminder to change later -- they show nontheless.

about the config file -- I didn't really notice any problems specifically with the comments but that could explain why my database was getting corrupted often (variables should up in the wrong areas and couldn't delete fields due to bad variables.)

Yes, the japanese character thing could be a problem but I don't know why I can't use them anyways, other Japanese scripts don't seem to have this incompatabilty problem -- you know, DBman is just great!!)

Thanks JP

forgot to add the address Smile

http://www2.comco.ne.jp/~carsten/dbman/default.cfg
http://www2.comco.ne.jp/~carsten/dbman/html.pl

Hopes for success .....

[This message has been edited by jdunes (edited March 09, 1999).]
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
I feel really stupid and I'm sorry that I didn't think of this before. Put quotes around the names of the select fields:

'year-gt' => '1985,1986,etc

Sorry.



------------------
JPD


Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Oh, my! A goddess?! Smile

"Greater than or equal to" is a problem, as is "less than or equal to." At present, DBMan doesn't allow for it. But you could get sneaky, if you wanted to. (I love getting sneaky. Smile )

In sub query, close to the beginning of the subroutine, just after

local (%sortby);

you could add your sneaky bit.

Code:
if ($in{'year-gt'}) {
--$in{'year-gt'};
}
if (in{'year-lt'}) {
++$in{'year-lt'};
}

Do the same thing with the pricevalue fields.

What happens with this -- say you want to look for the years 1986 through 1990, inclusive. With my sneaky bit above, DBMan thinks you are looking for greater than 1985 and less than 1991. Everybody's happy! Smile




------------------
JPD



Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
SCREW JP DAY, Let's make it all hail JPDeni Goddess Day!!!

It works -- joy joy

Caught a small logic error myself Smile You can't do pricevalue searches on price variables.. Dah, that was really stupid of me, I wonder what I was thinking the other night.

Now, Goddess JP could you bestow on the masses the secret of doing "= or >" (greater or equal than) searches of course the opposite. Got a small problem of looking up a year ie; 1991 starting with 1991 to 1994 (logic shows 1992 to 1993) ummm, don't have a test data for that yet but, if greater than has this small glitch than maybe the less than will too.

It's not in the readme Frown

thank you thank you thank you JP ! ! !

PS, I always try to be nice to people except for dork head drivers -- uhuh they do get the bird. but it's not that effective here in japan. Smile
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
SCREW JP DAY, Let's make it all hail JPDeni Goddess Day!!!

It works -- joy joy

Caught a small logic error myself Smile You can't do pricevalue searches on price variables.. Dah, that was really stupid of me, I wonder what I was thinking the other night.

Now, Goddess JP could you bestow on the masses the secret of doing "= or >" (greater or equal than) searches of course the opposite. Got a small problem of looking up a year ie; 1991 starting with 1991 to 1994 (logic shows 1992 to 1993) ummm, don't have a test data for that yet but, if greater than has this small glitch than maybe the less than will too.

It's not in the readme Frown

thank you thank you thank you JP ! ! !

PS, I always try to be nice to people except for dork head drivers -- uhuh they do get the bird. but it's not that effective here in japan. Smile
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Okay did that:
but got this:
CGI ERROR
==========================================
Error Message : fatal error: Can't call method "in" in empty package "year-lt" at /home2/carsten/.//public_html/cgi-bin/dbman/db.cgi line 329.

Script Location : /home2/carsten/.//public_html/cgi-bin/dbman/db.cgi
Perl Version : 5.003
Setup File : default.cfg
User ID : Boss
Session ID : Boss.92111996277264

Form Variables
-------------------------------------------
db : default
keyword :
mh : 10
so : ascend
uid : Boss.92111996277264
view_records : View Records
year-gt : 1990
year-lt : 1992

I did a 1991 to 1992 search. And I put the code in as:
local (%sortby);

if ($in{'year-gt'}) {
--$in{'year-gt'};
}
if (in{'year-lt'}) {
++$in{'year-lt'};
}
if ($in{'price-gt'}) {
--$in{'price-gt'};
}
if (in{'price-lt'}) {
++$in{'price-lt'};
}

# First thing we do ........

Did I screw up somewhere Frown
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Yep. We both screwed up. I made a typo, and you didn't catch it. Smile

You need to have a $ in front of the "in":

if ($in{'year-lt'}) {

if ($in{'price-lt'}) {

That'll make it work. Sorry.

(What was that mantra that farlane gave us? Smile )


------------------
JPD





[This message has been edited by JPDeni (edited March 10, 1999).]
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
God you give a woman Goddess status and they still find a way to involve you Smile

Goddess JP has blessed the masses once again with her miracles.

It works, I even got it working with double searches!

Don't ask me why I didn't catch it, I was lucky enough to find the right place to put it in. (boy, this sounds like one of those lewd email's that my friends send me Smile )

But seriously JP, thanks a lot. I'm so happy today that I'm only going to browse the net and soak in the joy of getting things moving forward again. I guess, I'll have to buy some earl grey to salute you!!
Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Well, it's people like you (and others who have been so nice) who keep me coming back here. I get a lot of laughs and a great deal of joy from reading that your database works the way you want it to.

If you try the Earl Gray, be sure not to put any milk or sugar in it. Plain tea is fine with additions, but Earl Gray needs to be enjoyed in its unadorned state. Smile


------------------
JPD





Quote Reply
Re: Can I use -gt and -lt used in select fields? In reply to
Hi teachies,

Guess, why don't start an Earl Gray forum one of these days about how to install it (cup requirements), how to configure it (no milk, no sugar), how to use it (proper English-like positioning of the fingers holding the cup), etc.

I think new releases must be covered (to avoid heat tea-ssipation) and custom mods should be addressed (especially for left-handers). Do you think tea is feasible ?

Don't forget the hot line ! And a cold one for iced tea ?

With a few tea-chers, training courses could be setup in the near future.

And for advertizing, why don't use tea-shirts ?

But I don't want to tease you anymore...

Have a good teaste of life !

Cheers,
Germinatea V.

[This message has been edited by Germinator (edited March 12, 1999).]