php-general | 2001032
Date: 03/29/01
- Next message: Jason Stechschulte: "Re: [PHP] rewrite one line in file"
- Previous message: Nick Davies: "Re: [PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Maybe in reply to: Boget, Chris: "[PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Next in thread: Stuart J. Browne: "Re: [PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Reply: Stuart J. Browne: "Re: [PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Doesn't the command return 1 or 0 in success or failure?
Not 1 or 0. It returns 0 or some other value. Almost the same,
but not quite.
> You may not have a result
> Probably wrong but something like
> if (mysql_query($query)) {
> } else {
> }
> or you could die out mysql_query($query) or die ........
You could do that. But once you run the query, that's it. You'll
have nothing to use with any of the other mysql functions because
you need to pass to them the value that mysql() returns. So while
the above might tell you whether or not the query succeeded, that's
all you would get out of it.
Chris
- Next message: Jason Stechschulte: "Re: [PHP] rewrite one line in file"
- Previous message: Nick Davies: "Re: [PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Maybe in reply to: Boget, Chris: "[PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Next in thread: Stuart J. Browne: "Re: [PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Reply: Stuart J. Browne: "Re: [PHP] RE: [PHP-DB] Best way to check if a query succeeded"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

