PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have this script to search mysql, works perfectly,
only need a description when nothing was found, something like "the result is not found. "
please help I have not managed to solve it.
<?php
mysql_connect ("localhost", "user","pass") or die (mysql_error());
mysql_select_db ("db_name");
$term = $_POST['term'];
$sql = mysql_query("select * from radio where beschrijving like '%$term%' ORDER by titel");
while ($row = mysql_fetch_array($sql))
<?php
$sql = mysql_query("select * from radio where beschrijving like '%$term%' ORDER by titel");
$rows = mysql_num_rows($sql);
if ($rows == 1) {
// code that displays results
}
else {
// no rows matchin query
echo 'the result is not found';
}
?>
Hth
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering