This question already has an answer here:
**
This question already has an answer here:
mysql_fetch_array() expects parameter 1 to be resource (or mysqli_result), boolean given 31 answers
Hi im trying to write the data from my database and this the code thats meant to be doing it but i get two of the 'Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given' and dont know why???? **
<?php
$connection = mysql_connect("localhost", "root", "");
// Establishing Connection with Server
$db = mysql_select_db("burger machine", $connection);
// Selecting Database
//MySQL Query to read data
$query = mysql_query("select * from add", $connection);
while ($row = mysql_fetch_array($query)) {
echo "<tr>";
echo " <td> {$row['Addons_id']} </td>";
echo " <td> <a href=\"Ao.php?update={$row['Addons_id']}\"> {$row['Addons_Name']} </a> </td> ";
echo " <td> {$row['Addons_Price']} </td> ";
echo " <td> {$row['Addons_Description']} </td>";
echo "</tr>";
}
</div>