Getting frustrated with simple PHP/MySQL problem
For some reason a simple database connection script that was working fine is now throwing up the following error message:
The code is as follows:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/bounce6/public_html/inf.php on line 45
Line 45 is the beginning of the while statement.
$connect = mysql_connect($dbhost, $dbuser, $dbpasswd) or die (mysql_error());
$recent_sql = "SELECT id, title, type, price, description, hire, age, adults, requirements, overnight, picture, dim, gallerypics FROM range WHERE type='$choice'ORDER BY price ASC";
while ($recent = mysql_fetch_array($result))
[I].... print out results[/I]
Can someone tell me if there's any problem with that PHP code, or if there's any other reason why these errors may now have suddenly started cropping up.
From an SQL point of view, I've checked that the name of the table is correct and that all of the table fields are valid ... and it's still not working. Is there something else I should be checking??
Thanks very much for your help ...