Jump to content

Archived

This topic is now archived and is closed to further replies.

lwharding

Help with Select statements

Recommended Posts

I am having a difficulty with a certain search query I am trying to execute within Dreamweaver.

I am attempting to create an number range search of a MySQL db; I have created a forms within a plain old html page that passes two fields ('from' and 'to') to the search page using 'GET' within a form. Then I have created a php page with a records set and the following SQL statement:

===============================================
[b]SELECT hp.Name, hp.Age
FROM hp
WHERE hp.Age BETWEEN 'from' AND 'to'
ORDER BY hp.Age ASC[/b]
===============================================

I have entered in variables for the 'from' and 'to' fields to ensure that the above syntax is correct, which it is. However when executing the page it returns no results!

Any ideas on this are greatly appreciated as I am well and truely stumped!

Share this post


Link to post
Share on other sites
This has been resolved. Problem was I was using 'from' within search syntax. Doh!

[!--quoteo(post=345339:date=Feb 13 2006, 11:48 AM:name=Luke Harding)--][div class=\'quotetop\']QUOTE(Luke Harding @ Feb 13 2006, 11:48 AM) [snapback]345339[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I am having a difficulty with a certain search query I am trying to execute within Dreamweaver.

I am attempting to create an number range search of a MySQL db; I have created a forms within a plain old html page that passes two fields ('from' and 'to') to the search page using 'GET' within a form. Then I have created a php page with a records set and the following SQL statement:

===============================================
[b]SELECT hp.Name, hp.Age
FROM hp
WHERE hp.Age BETWEEN 'from' AND 'to'
ORDER BY hp.Age ASC[/b]
===============================================

I have entered in variables for the 'from' and 'to' fields to ensure that the above syntax is correct, which it is. However when executing the page it returns no results!

Any ideas on this are greatly appreciated as I am well and truely stumped!
[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.