MySQL Forums
Forum List  »  Newbie

Re: POST_data from a form as value in a mysql WHERE clause
Posted by: Nathan Ziarek
Date: July 15, 2005 01:43PM

I am by no means an expert (as will be evidenced by the rest of this message), and I've learned entirely from trial and error. I'll tell you what I've run into and see if it helps.

Not to condesend, but I just want to make sure that in your actual code, 'server' 'user' and 'pass' are actual values and not those words.

> $query = 'SELECT * FROM tolet2 WHERE price >= $price';
I don't think PHP will substitute a variable within single quotes. If you change it to
> $query = "SELECT * FROM tolet2 WHERE price >= $price";
-- OR
> $query = 'SELECT * FROM tolet2 WHERE price >= ' . $price;

then it works for me (at least on my system, your code doesn't work)...try echoing the $query to make sure it looks right.

The other thing you might want to try is to set error_reporting to E_ALL [put "error_reporting(E_ALL);" at the top of your script] to see if there are any errors being generated that might help you out.

Once again, I am no expert, so if my suggestions are are way below your level, tell me to stuff it and i'll keep quiet.

Options: ReplyQuote




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.