note 29167 added to function.mysql-fetch-array

From: Date: Wed, 05 Feb 2003 00:51:44 +0000
Subject: note 29167 added to function.mysql-fetch-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-43423@lists.php.net to get a copy of this message
Need help pleaseeeeee.... I have been sitting and looking at this code for several days now... it's driving me INSANE. the error i keep getting is "warning: mysql_fetch_array();: supplied argument is not a valid MySQL result resource in /home/evankro/public_html/dvd_out.php on line 27" there is my code..... <html> <head> <title>DVD Collection</title> </head> <body bgcolor="#FFFFFF"> <h1>DVD Collection</h1> Order DVD's by <a href="dvd_out.php?orderby=title">Title</a>, <a href="dvd_out.php?orderby=director">Director</a> or by <a href="dvd_out.php?orderby=genre">Genre</a>. <p> <table border="1" cellpadding="3"> <?php $db = mysql_connect("localhost","evankro_dvd"); mysql_select_db("php", $db); if($orderby == 'title'): $sql = "select * from dvd order by 'title'"; elseif ($orderby == 'director'): $sql = "select * from dvd order by 'director'"; elseif ($orderby == 'genre'): $sql = "select * from dvd order by 'genre'"; elseif (isset($submit)): else: $sql = "select * from dvd"; endif; $result = mysql_query($sql); while ($row = mysql_fetch_array($result, MYSQL_NUM)) { print("<tr><td bg color=\"#003399\"><b>"); printf("<font color=\"white\">%s</font></b></td></tr>\n", $row["genre"]); printf("<td>Directed by ", $director, $row["director"], $row["director"]); printf("<br>Posted: %s<hr>\n", $row["date"]); printf("%s</td></tr>\n", $row["info"]); } ?> </table> </body> </html> -- http://www.php.net/manual/en/function.mysql-fetch-array.php http://master.php.net/manage/user-notes.php?action=edit+29167 http://master.php.net/manage/user-notes.php?action=delete+29167 http://master.php.net/manage/user-notes.php?action=reject+29167

« previous php.notes (#43423) next »