Here's a script I recently wrote and I'm really new with this stuff so here goes..
<body>
<?PHP
$db = mysql_connect("localhost", "turbo");
mysql_select_db("dsl",$db);
// display individual record
if ($id) {
$result = mysql_query("SELECT * FROM onemeg WHERE wtn='$id'",$db);
$myrow = mysql_fetch_array($result);
printf("WTN: %s\n<br>", $myrow["wtn"]);
printf("Available: %s\n<br>", $myrow["qualified"]);
printf("Equipment: %s\n<br>", $myrow["equip"]);
printf("Trouble: %s\n<br>", $myrow["trouble"]);
printf("Line Sync: %s\n<br>", $myrow["sync"]);
printf("Line Type: %s\n<br>", $myrow["rb"]);
}
else {
echo "Sorry, no records were found!";
}
?>
</body>
If a result set comes back from MySQL empty, it will not default to the "Sorry, no records found" etc... I would like it to default to the Sorry no records if the results are zero.
I have other questions, but that will get me started..🙂 If it finds a valid phone number during it's search it displays the fields properly which is great... my other questions in future will be how to manipulate (if, then statements) the data to be more visitor friendly...
Thanks in advance! 🙂
Paul