I am getting this warning
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
and my code is
Expand|Select|Wrap|Line Numbers
- <?php
- $con = mysql_connect("localhost","sandman","sandcastle");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- print "Connected to MySQL<br>";
- mysql_select_db("sandbox", $con);
- $result = mysql_query("SELECT parcel,location from accessor");
- echo "<table border='1'>
- <tr>
- <th>Parcel</th>
- <th>Location</th>
- </tr>";
- while($row = mysql_fetch_array($result))
- {
- echo "<tr>";
- echo "<td>" . $row['parcel'] . "</td>";
- echo "<td>" . $row['location'] . "</td>";
- echo "</tr>";
- }
- echo "</table>";
- mysql_close($con);
- ?>