lwharding Posted February 13, 2006 Share Posted February 13, 2006 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.AgeFROM hpWHERE 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 Link to comment https://forums.phpfreaks.com/topic/3404-help-with-select-statements/ Share on other sites More sharing options...
lwharding Posted February 15, 2006 Author Share Posted February 15, 2006 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.AgeFROM hpWHERE 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] Quote Link to comment https://forums.phpfreaks.com/topic/3404-help-with-select-statements/#findComment-11781 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.