Page 2 of 2

Posted: Sat Aug 12, 2006 11:22 am
by Chris Corbyn
To clarify

Code: Select all

$result = mysql_query($query) or die(mysql_error());

Posted: Sun Aug 13, 2006 12:06 am
by ityd
not a valid MySQL result resource
This error usually happens when: you have not conected to the server, you have not chosen a database, or when there is a syntax error in your query to the database. Use d11wtq's advice and add or die(mysql_error());. However if your using the same code as in the other server, most likely there is a problem with your database or configuration of your new server.

Also before your while loop you initialized variable $i and incremented in the loop, yet that is all you do with it, just wondering why that is.

Posted: Sun Aug 13, 2006 4:12 am
by Benjamin

Code: Select all

$sql = "SELECT * FROM pixels WHERE viewable= 'Y' AND adult = 'N' ORDER BY created DESC LIMIT 0,4";
Should be..

Code: Select all

$sql = "SELECT * FROM `pixels` WHERE `viewable`= 'Y' AND `adult` = 'N' ORDER BY `created` DESC LIMIT 0,4";