note 29167 rejected from function.mysql-fetch-array by maxim

From: Date: Wed, 05 Feb 2003 01:23:44 +0000
Subject: note 29167 rejected from function.mysql-fetch-array by maxim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-43424@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>

« previous php.notes (#43424) next »