dabbling with PHP/MYSQL and it works ok but stupidly havign difficulty in returning informative text (eg; no results returned) when no matching records are returned, the code below works to retrieve.
How do I return the no results returned etc?
How do I return the no results returned etc?
Code:
$link_id = mysql_connect("localhost","root","**********");
mysql_select_db("printservers",$link_id);
$sql = "SELECT * FROM printserverstable";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
{
echo "<center><table WIDTH = 810 BORDER =1>";
echo "<tr width = 810>";
echo "<td WIDTH = 110>".$row['location']."</td>";
echo "<td WIDTH = 110>".$row['sublocation']."</td>";
echo "<td WIDTH = 140>".$row['brand']."</td>";
echo "<td WIDTH = 110><A HREF = ".$address,$row['ipaddress'].">".$row['ipaddress']."</A></td>";
echo "<td WIDTH = 110>".$row['updatedby']."</td>";
echo "<td WIDTH = 140>".$row['comments']."</td>";
echo "<td WIDTH = 110>".$row['id']."</td>";
echo "</tr>";
echo "</table></center>";
}