RE: [PHP] Simple Question

From: Date: Wed, 25 Oct 2000 23:11:39 +0000
Subject: RE: [PHP] Simple Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21965@lists.php.net to get a copy of this message
change mysql_db_query to @mysql_db_query. The '@' sign supresses the error output. you can use mysql_error() to get any error message resulting from the last executed mysql command. this will tell you if you have a result or an error... hth richard -----Original Message----- From: Chris [mailto:php_list@ibcnetwork.net] Sent: Monday, October 23, 2000 9:41 AM To: php Subject: [PHP] Simple Question Hi, I looked in the manual but can't find anything to help. How do I repress mysql errors from displaying? Ex: $strsql = "SELECT myval FROM table where date = '$strdte'"; $result = mysql_db_query("db",$strsql); How can I see if $result is valid? When I do echo $result, it allways prints the number 2, whether is finds data or not. If not it give me the error that mysql can jumpt to row 0 on the next statement which is: $strmydte = mysql_result($result,"myval"); I need to see if there is a result before I reach the above line so I can prevent the error display and do something else. Thanks, Chris

« previous php.general (#21965) next »