Odp: [PHP-DB] Best way to check if a query succeeded

From: Date: Thu, 29 Mar 2001 11:20:23 +0000
Subject: Odp: [PHP-DB] Best way to check if a query succeeded
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7967@lists.php.net to get a copy of this message
I do the same and I think this is the only way Bartek Pawlik ----- Original Message ----- From: Jordan Elver <jjelver@worldsites.net> To: PHP Database Mailing List <php-db@lists.php.net>; PHP General Mailing List <php-general@lists.php.net> Sent: Thursday, March 29, 2001 1:00 PM Subject: [PHP-DB] Best way to check if a query succeeded > 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 > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > --

« previous php.db (#7967) next »