Re: verifying sql INSERTs
| From: | John W. Holmes | Date: | Tue, 26 Aug 2003 00:36:39 +0000 |
| Subject: | Re: verifying sql INSERTs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160695@lists.php.net to get a copy of this message | ||
Chris W. Parker wrote:
Hi! (MySQL) What's the best way to determine a sql INSERT statement has executed successfully?You should use mysql_error() to ensure your query did not fail for any reason. Assuming the query was successful, you can use mysql_affected_rows() to see if it actually had any impact on the database, i.e. the row was inserted. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com