Re: verifying sql INSERTs
| From: | CPT John W. Holmes | Date: | Tue, 26 Aug 2003 16:56:16 +0000 |
| Subject: | Re: verifying sql INSERTs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160809@lists.php.net to get a copy of this message | ||
From: "Chris W. Parker" <cparker@swatgear.com>
> I should instead just try to perform the INSERT and then if it fails I
> know I've already got a record. If it doesn't I know everything is cool.
If it is a certain kind of failure, then you have a duplicate, otherwise it
could be another type of failure/error. Use mysql_errno() to make sure you
catch the right error as a duplicate.
---John Holmes...