MySQL Forums :: Newbie :: Not working in MYSQL5.1


Advanced Search

Not working in MYSQL5.1
Posted by: David Jackson ()
Date: August 18, 2010 05:43AM

Since MYSQL was upgraded to V5 on my server, my code now fails with invalid syntax. It worked fine before. Can anyone tell me what I need to change?

Code is:

$getrange = $_GET['rangesel'];
$getwood = $_GET['woodsel'];
$getroom = $_GET['roomsel'];

if ($getrange == 'All') {
$getrange = '%';
}
if ($getwood == 'All') {
$getwood = '%';
}
if ($getroom == 'All') {
$getroom = '%';
}

SELECT stocknum FROM stock where range like '$getrange' and wood like '$getwood' and room like '$getroom'"

Basically, where $_GET formfields == "All" I want to select rows with any value in that field

Options: ReplyQuote


Subject Written By Posted
Not working in MYSQL5.1 David Jackson 08/18/2010 05:43AM
Re: Not working in MYSQL5.1 laptop alias 08/18/2010 06:14AM
Re: Not working in MYSQL5.1 David Jackson 08/18/2010 06:37AM
Re: Not working in MYSQL5.1 laptop alias 08/18/2010 06:39AM
Re: Not working in MYSQL5.1 David Jackson 08/18/2010 06:46AM
Re: Not working in MYSQL5.1 laptop alias 08/18/2010 07:34AM
Re: Not working in MYSQL5.1 David Jackson 08/18/2010 06:40AM
Re: Not working in MYSQL5.1 Shawn Taylor 08/19/2010 11:32AM
Re: Not working in MYSQL5.1 Rick James 08/19/2010 08:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.