I have the following code, that outputs Firstnames and Lastnames from a table inside a database.
How do I display a message if the database/table contains no Firstnames and Lastnames?
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die(mysql_error());
}
mysql_select_db("db", $con);
$result = mysql_query("SELECT * FROM person");
while($row = mysql_fetch_array($result))
{
echo $row['FirstName'].'<br />';
echo $row['LastName'].'<br />';
}
mysql_close($con);
?>