MySQL Forums
Forum List  »  Newbie

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
August 18, 2010 05:43AM
August 18, 2010 06:14AM
August 18, 2010 06:37AM
August 18, 2010 06:39AM
August 18, 2010 06:46AM
August 18, 2010 07:34AM
August 18, 2010 06:40AM
August 19, 2010 11:32AM
August 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.