Hi I am new to Php.I am trying to read My sql database data from table to php.
I am getting this warning
Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result resource
and my code is
[code=php]
<?php
$con = mysql_connect(" localhost","san dman","sandcast le");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
print "Connected to MySQL<br>";
mysql_select_db ("sandbox", $con);
$result = mysql_query("SE LECT parcel,location from accessor");
echo "<table border='1'>
<tr>
<th>Parcel</th>
<th>Location</th>
</tr>";
while($row = mysql_fetch_arr ay($result))
{
echo "<tr>";
echo "<td>" . $row['parcel'] . "</td>";
echo "<td>" . $row['location'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($co n);
?>
[/code]
plz let me know where I am doing wrong
I am getting this warning
Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result resource
and my code is
[code=php]
<?php
$con = mysql_connect(" localhost","san dman","sandcast le");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
print "Connected to MySQL<br>";
mysql_select_db ("sandbox", $con);
$result = mysql_query("SE LECT parcel,location from accessor");
echo "<table border='1'>
<tr>
<th>Parcel</th>
<th>Location</th>
</tr>";
while($row = mysql_fetch_arr ay($result))
{
echo "<tr>";
echo "<td>" . $row['parcel'] . "</td>";
echo "<td>" . $row['location'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($co n);
?>
[/code]
plz let me know where I am doing wrong
Comment