Yes, you are right! mysql_info() is not most useful. It does give me number of rows matched but will involve complications of parsing the string.
Is there no other way to this? How can this be missed? I am not so convinienced on mysql_info()! On 6/11/07, Jerry Schwartz <[EMAIL PROTECTED]> wrote:
Have you looked at mysql_info()? The format of the return value might not be the most useful, but it should give you what you need. Regards, Jerry Schwartz The Infoshop by Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 www.the-infoshop.com www.giiexpress.com www.etudes-marche.com > -----Original Message----- > From: ViSolve DB Team [mailto:[EMAIL PROTECTED] > Sent: Monday, June 11, 2007 6:15 AM > To: Ace; mysql@lists.mysql.com > Subject: Re: how to get Number of rows matched? > > Hi > > AFAIK, before changing data, the old values are saved in the rollback > segment. > On saving the updated values, from the Buffer to the rollback > segment/data > files, > --- it checks if there is any matched row that matches the > condition. If > found, then flags "Matched". > ---after filtering out the matched row, it check whether > there is need to > change the old value to new value. if need then flags > "Changed" and rewrite > the same in the datafile/rollback segment. > > > Thanks > ViSolve DB Team. > ----- Original Message ----- > From: "Ace" <[EMAIL PROTECTED]> > To: <mysql@lists.mysql.com> > Sent: Monday, June 11, 2007 11:41 AM > Subject: how to get Number of rows matched? > > > > Hi Experts, > > > > When issuing updates in mysql (in the console window), > mysql will tell > > you if any rows matched and how many rows were updated (see > below). I > > know how to get number of rows udpated using > mysql_affected_rows(), but is > > there any > > way to get the number of rows matched? I want to find out, > when rows > > updated = 0, if there were no updates because the row wasn't found > > (rows matched will = 0) or because the update would not have changed > > any data (rows matched = 1). > > > > mysql> select * from test; > > +------+------+ > > | roll | s | > > +------+------+ > > | 1 | new | > > +------+------+ > > 1 row in set (0.00 sec) > > > > mysql> update test set roll = 1, s = 'new' where roll = 1; > > Query OK, 0 rows affected (0.00 sec) > > Rows matched: 1 Changed: 0 Warnings: 0 > > > > mysql> update test set roll = 1, s = 'new' where roll = 17; > > Query OK, 0 rows affected (0.00 sec) > > Rows matched: 0 Changed: 0 Warnings: 0 > > > > mysql> update test set roll = 1, s = 'neww' where roll = 1; > > Query OK, 1 row affected (0.00 sec) > > Rows matched: 1 Changed: 1 Warnings: 0 > > > > -- > > Cheers, > > Rajan > > > > > -------------------------------------------------------------- > ------------------ > > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.472 / Virus Database: 269.8.13/843 - Release > Date: 6/10/2007 > 1:39 PM > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > >