I am getting this error on my index.php page where i have also included the code
Warning: mysql_fetch_a
You have quoted your table name in single-quote characters, which MySQL interprets as a string literal. You should either use backticks, or no quote characters at all:
$sql = "SELECT * FROM `menulinks`";
This syntax error caused the mysql_query()
function to return false, which you can test as follows:
$result = mysql_query($sql) or die(mysql_error());
Also note, as documented in a big red box at the top of the manual page for mysql_query():
Suggested alternatives
Use of this extension is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
- mysqli_query()
- PDO::query()