Use mysql_num_rows() to return the amount of rows selected with your query.


/* DB connection stuff comes here */

$query = "SELECT * FROM table";
$getdata = mysql_query($query);

   // output fetched rows
   echo "no terms";

"Jonathan Narong" <[EMAIL PROTECTED]> wrote in message
> maybe i'm totally not thinking straight right now, but is there a way in
> to check if 0 results are returned in a mysql query?
> for example, i have a definition database, that has a list of letters the
> user clicks on (click on the letter, and all the terms for that letter pop
> up).. but for some letters there are no terms. so i just wanted to echo
> a simple "no terms" message or something. in any case, i need to check if
> there are no results from a mysql query (an error won't be returned).
> thanks ..
> -jon

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to