Msg#: 4455663 posted 8:21 pm on May 20, 2012 (gmt 0)
I suspect gremlins. I've got a simplest MySQL query
$toProcess = mysql_query("SELECT * FROM url_list ORDER BY id DESC LIMIT 7 WHERE type='get'");
The first time I ran the test script I got a blank screen. Then I hit F5 and got a Syntax error message suggesting that I have to consult the manual and check for errors around WHERE type='get' I hit F5 again and I got a blank screen again.
Unless both the MySQL manual and W3schools tutorial are wrong, there is no syntax error in my query.
Msg#: 4455663 posted 9:40 pm on May 20, 2012 (gmt 0)
I should have read the query more closely rather than the scenario. Your syntax is a little off
SELECT * FROM url_list WHERE type='get' ORDER BY id DESC LIMIT 7
The WHERE part of the query is in the wrong place, the above is the correct place. If you think of the SQL as left to right logic it makes sense that the WHERE statement should be there, as ordering and limiting would be done after the filtering done in the WHERE command.