[PHP] mysql upate return false?
I have a function update_trans(); in a mysql_query() that processes an update, what could i check for to see if it was successful or not. The update only updates 1 row. Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql upate return false?
mysql_affected_rows() On Thu, 22 Aug 2002, Randy Johnson wrote: I have a function update_trans(); in a mysql_query() that processes an update, what could i check for to see if it was successful or not. The update only updates 1 row. Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql upate return false?
mysql_query($sql_statement) or die (Couldn't run UPDATE statement); Adam On Thu, 22 Aug 2002, Randy Johnson wrote: I have a function update_trans(); in a mysql_query() that processes an update, what could i check for to see if it was successful or not. The update only updates 1 row. Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql upate return false?
Is this a proper way to see if an insert has failed? $Query=insert blah into blah where blah=blah; if (! mysql_query($Query,$link)) { $dberror= mysql_error() } Is there a better way to do it? Randy - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Randy Johnson [EMAIL PROTECTED] Cc: Rodrigo Peres [EMAIL PROTECTED]; PHP [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 10:52 AM Subject: Re: [PHP] mysql upate return false? mysql_affected_rows() On Thu, 22 Aug 2002, Randy Johnson wrote: I have a function update_trans(); in a mysql_query() that processes an update, what could i check for to see if it was successful or not. The update only updates 1 row. Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql upate return false?
That's fine. On Thu, 22 Aug 2002, Randy Johnson wrote: Is this a proper way to see if an insert has failed? $Query=insert blah into blah where blah=blah; if (! mysql_query($Query,$link)) { $dberror= mysql_error() } Is there a better way to do it? Randy - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Randy Johnson [EMAIL PROTECTED] Cc: Rodrigo Peres [EMAIL PROTECTED]; PHP [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 10:52 AM Subject: Re: [PHP] mysql upate return false? mysql_affected_rows() On Thu, 22 Aug 2002, Randy Johnson wrote: I have a function update_trans(); in a mysql_query() that processes an update, what could i check for to see if it was successful or not. The update only updates 1 row. Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php