Best way to check if a query succeeded

From: Date: Thu, 29 Mar 2001 11:00:05 +0000
Subject: Best way to check if a query succeeded
Groups: php.db php.general 
Request: Send a blank email to php-db+get-7965@lists.php.net to get a copy of this message
Hi, i was just wondering what you guys do to check if a wquery suceeded or not? I know about mysql_num_rows() and mysql_affected_rows(), just wondered what you guys do? I normally do something like: $sql = "SELECT something FROM table"; $result = mysql_query($sql); if(@mysql_num_rows($result) > 0) { echo'Query Suceeded'; } else { echo'Query failed'; } Cheers, Jord

« previous php.db (#7965) next »