Possible Duplicate:
“Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given” error while trying to create a php shopping cart
<?php
//connect to MYSQL
$con=mysql_connect("localhost","root","");
if (!$con)
{
die ('cannot connect:'.mysql_error());
}
//to show the original message
mysql_select_db("tracking", $con);
$result = "SELECT lat, lng, DATE_FORMAT(datetime,'%W %M %D, %Y %T') AS datetime FROM markers1 WHERE 1";
if (!$result) { // add this check.
die('Invalid query: ' . mysql_error());
}
echo "<table border='1'>
<tr>
<th>id No</th>
<th>lat Time</th>
<th>lng</th>
<th>datetime</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['lat'] . "</td>";
echo "<td>" . $row['lng'] . "</td>";
echo "<td>" . $row['datetime'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
It show me mysql_fetch_array() expects parameter 1 to be resource.
Can anyone help me .thx.