This one has 2 tech teams baffled.
I have an HTML form that submits to a PHP script that generates the following simple MySQL command:
SELECT * FROM table WHERE parameter='something';
The problem is, when I run the PHP script, I get an empty set returned. However, when I type the command into SQL manually, it works fine and returns rows as it should. The closest guess I can figure is, the pasted command has some sort of hidden characters in it ... ?
Any advice is greatly appreciated
EDIT:
exact PHP query:
$query = mysql_query("SELECT * FROM Residential WHERE ".$parameters." ORDER BY 'Residential','list_price' ASC LIMIT ".$offset.", ".$listinglimit."; ") or die('Could not connect: ' . mysql_error());
echo'd query (which is also submitted to MySQL):
SELECT * FROM Residential WHERE sub_area_name='TJ–Trojan' AND list_price <= 99999999 ORDER BY 'Residential','list_price' ASC LIMIT 0, 10;
If I paste that query into phpmyadmin, the result is an empty set. But if I type it manually then the result is returned rows (as it should be)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…