Re: mysql improved extensions affected_rows

From: Date: Thu, 13 Jan 2005 23:07:55 +0000
Subject: Re: mysql improved extensions affected_rows
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-206334@lists.php.net to get a copy of this message
Tom wrote: > I've just started playing with the php5 improved mysqli extensions. > > I have the following code:- > > <?php > $mysqlim = new mysqli("localhost", "myUser", > "myPassword","myDB"); > > $updateQuery = "UPDATE client SET status = 'INACTIVE' WHERE clientName = > 'Tom'"; > > if ($mysqli->query($updateQuery)) > { > $updateCount = $mysqli->affected_rows; > echo "<br>updateCount = $updateCount"; > } > else > { > excpetionHandler("updateFailed: ".$updateQuery); > } > ?> > > > This returns "updateCount = 1" > However, when I check the underlying table, there are actually 4 rows > updated (and yes, before anyone asks, I have repeated this several > times, correctly resetting the data before each run) > > Is this a known bug, or am I doing something stupid? > (php 5.0.2, apache 2.0.49) How many rows actually had 'Tom' for their clientName?... I mean, is the '1' wrong because it should be 4, or is it changing records it shouldn't? -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#206334) next »