PDA

View Full Version : Error of some sort with getting info from MySQL table?


FethrdWlf
03-20-2011, 01:27 AM
When I try to access some information from a MySQL server and display it in a table, it gives this error:

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\summerservices\includes\frontpage. php on line 13

And the PHP I'm using to access the data:

<?php
$query = "SELECT * frontpage";
$result = mysqli_query($cxn,$query);

//Display the results in a table
echo "<table cellspacing='0' border ='0' cellpadding='0' width='100%'>";
echo "<tr><td colspan='100%' style='text-align: center'><hr />Updates on the business:<hr /></td></tr>\n";
while($row = mysqli_fetch_assoc($result)){
echo "<tr><td colspan='100%'>{$row['message']}</ hr></td></tr>\n";
echo "</table>\n";
}
?>All of that was/is within a <div> tag. Then, that PHP file with the div is included in the main page of my site.

davidj
03-30-2011, 11:06 AM
Your SQL is wrong

should be..

SELECT * FROM TABLE