Gossamer Forum
Home : Products : DBMan : Customization :

searching by price from a link on a page

Quote Reply
searching by price from a link on a page
I am wanting to have a link on a page that can be clicked on and it will list products under a certain price. I am currently using this link and it is not working. Any ideas?

http://www.absolutedesire.com/cgi-bin/dbman/db.cgi?db=products&view_records=1&Category=Video&Price-lt>$20.00&ww=1&sb=4&so=ascend

Queticon
Quote Reply
Re: searching by price from a link on a page In reply to
The problem is that you do not have an equal character in the Price-lt argument in the query string. Also, the $ sign and period may be causing you problems in the query string. Try using 20 rather than $20.00.

Change your codes to the following:

Code:
http://www.absolutedesire.com/cgi-bin/dbman/db.cgi?db=products&view_records=1&Category=Video&Price-lt=20&ww=1&sb=4&so=ascend

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: searching by price from a link on a page In reply to
if I put Price-lt=20 or $20.00 or 20.00 it gives me the search page saying there is none. I cant figure this out

Queticon
Quote Reply
Re: searching by price from a link on a page In reply to
okay my database is configured with the price as number, but the data is not numbers...it is acutual prices $20.00 and so on it contains the $ sign in it.
this must be my problem.

Not sure of a fix other than finding a way to remove the dollar sign from over 3000 items.

any suggestions?

Queticon
Quote Reply
Re: searching by price from a link on a page In reply to
Well, you could load the .db file into a text editor and do a global search and replace -- replace $ with nothing. That's the only thing I can think of.



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






Quote Reply
Re: searching by price from a link on a page In reply to
okay I can do that actually with excel or access quickly actually....but on out put of the price could I do a \$$rec{'Price'} to get it to print out with a dollar sign in front of it?

Queticon
Quote Reply
Re: searching by price from a link on a page In reply to
Yep. That's the way to do it.


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






Quote Reply
Re: searching by price from a link on a page In reply to
Thanks JP,

I will try that in a bit. I think I am getting the hang of this. I still need to get the date to do what I want though. That one will be a little harder

Queticon
Quote Reply
Re: searching by price from a link on a page In reply to
What do you want the date to do?


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






Quote Reply
Re: searching by price from a link on a page In reply to
I would l ike all entries in the database that are 30 days old or newer to display a single gift. when you search through the items.

I would also like the results to display the newest items in the list first.

Queticon
Quote Reply
Re: searching by price from a link on a page In reply to
To display the newest items first, you would need to add two fields to your search form:

Code:
<input type="hidden" name="sb" value="the number of your date field">
<input type="hidden" name="so" value="descend">

That will cause the items to be listed out in reverse order from the date in the date field. In other words, with the most recent at the top.

I'm not quite sure I understand your other point. You want a graphic file to display next to items that were added in the past 30 days?

If so, I'll need you to post a .txt version of your html.pl file again. I'll need to look at it so I can tell you where the code would go.


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






Quote Reply
Re: searching by price from a link on a page In reply to
How is your Price field defined in your .cfg file? It must be "numer" datatype or it won't work.

Price-lt=20

would be the format you want to use.


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