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!
having tried a few things and done some research I can't seem to find the right syntax to test for "no result" and post a message like
"you have not signed up for any courses yet".
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
and it works fine when the original code I posted returns a result (it echos "3 rows") but
it doen't echo "0 rows" when no result is returned, in fact it doesn't echo anything at all.
So I'm still struggling to write an "if" statement to react to the user who hasn't signed up to any course.
if(!mysql_num_rows($result)) {
echo "No results...";
}
Or whatever.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.