Re: how to ?
| From: | David Otton | Date: | Tue, 11 Sep 2001 12:44:29 +0000 |
| Subject: | Re: how to ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66920@lists.php.net to get a copy of this message | ||
On Tue, 11 Sep 2001 08:40:05 -0400, you wrote:
>is there a way to tell if an insert failed while a in a loop. I tried this: $query = "my
>query";
>if (!$query)
>{
>logic here
>}
> but this is not working... is this even possible?
By query, are you talking about SQL? I'm assuming you're trying to do
run a MySQL INSERT statement.
if (mysql_query("INSERT INTO [...]", $connection)==0) {
/* failure */
}
Works for me, but is equivalent to what you appear to be doing. Can
you post a small piece of code showing what isn't working?
djo