Re: MySQL Result

From: Date: Fri, 08 Mar 2002 12:18:05 +0000
Subject: Re: MySQL Result
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-17569@lists.php.net to get a copy of this message
mysql_affected_rows(int resource_id); This will return the number of rows that were affected by the last operation, so you could do something like this: if(mysql_affected_rows($connection) == 1){ //insert, update or delete succeeded }else{ //operation failed } ----- Original Message ----- From: "Chris Payne" <chris@planetoxygene.com> To: <php-db@lists.php.net> Sent: Thursday, March 07, 2002 7:34 PM Subject: [PHP-DB] MySQL Result > Hi there everyone, > > I have delete working perfectly by doing the following: > > include("connectionstart.php"); > > mysql_query ("DELETE FROM emaillist WHERE EMail = '$email' > "); > > However, how do I return a true or false flag whether the row was deleted or > not? I basically need to know how to do a 0 or 1 I guess once the row has > been deleted or if the specified email address wasn't found. > > Thanks for your help everyone. > > Chris > > > -- > PHP Database Mailing List (http://www.php  /) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.db (#17569) next »