August 30, 200818 yr Hi all i am using te folloeing to find out how many rows in mysql that are called in a search $numrows=mysql_num_rows($query); the problem is sometimes it will fetch no rows and i get an error is there another way of getting around this thanks
August 31, 200818 yr Do you mean making it not display the error? Put this at the top of your script: error_reporting(0);
August 31, 200818 yr Author Do you mean making it not display the error? Put this at the top of your script: error_reporting(0); Hi again yes i have done this but just thought there may be a more profesional way of doing it as i am a beginer to php mysql thaks for the reply
August 31, 200818 yr $numrows=@mysql_num_rows($query); The @ will hide the error. Alternatively you can do another select by using SELECT COUNT(1) FROM tbl_name WHERE this = 'something' and other_thing = 2
Create an account or sign in to comment