Select latest entry from MySQL database error

TolaBoomo

New Member
\[code\]<?phpmysql_connect("localhost", "user", "password") or die(mysql_error());mysql_select_db("jmvarela_jacket") or die(mysql_error());$query = 'SELECT * FROM `quote` ORDER BY `id` DESC LIMIT 1'; $row = mysql_fetch_array( $query );echo $row['frase'];?>\[/code\]I cant get this to work. I get this error:\[quote\] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/jmvarela/public_html/ihateyourjacket.com/latest/index.php on line 7\[/quote\]I am trying to select the latest entry to the mysql database.The table is called "quote" There are three fields: id, frase and name.Just to clarify (because this could be VERY bad coding) I am trying to get the "biggest" id and to display it
 
Back
Top