0

What's wrong with this code:

<?php

include('include/con_database.php');

$result2 = mysql_query("SELECT * FROM banner ORDER BY DESC");

while ($data2 = mysql_fetch_array($result2)){

echo '<td>'.$data2['images'].'</td>'.'<br>';

}

?>

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\xampp\xampp\htdocs\IndonusaCMS\index.php on line 39

Line 39:  while ($data2 = mysql_fetch_array($result2)){
4
Contributors
4
Replies
21
Views
3 Years
Discussion Span
Last Post by rpv_sen
0

The reason you getting this error is that the mysql_fetch_array function expects a resource but is being passed a boolean. What you should know is that the mysql_query function will always return a boolean if there is an error in your query.
The error in your query has been pointed out by pritaeas.

0

Hi

Order by column_name is missing. check the syntax for reference

SELECT column_name(s) FROM table_name ORDER BY column_name(s) ASC|DESC
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.