On Mon, 1999-09-20 10:16:34 -0700, Scott Hess wrote:
> The problem is, the above snippet has a subtle failure mode. If the
> values I'm setting equal the values that currently exist, then the
> UPDATE will return that 0 rows were affected. There doesn't seem to
> be a reasonable way to determine this case, short of parsing the
> results of mysql_info(). Is there any way to get the number of
> matched rows from the UPDATE, even if they weren't modified?
As you seem to be using the C API, this might help:
mysql_real_connect() takes a client_flag!
One of the possible flag bits is:
Flag name Flag meaning
CLIENT_FOUND_ROWS Return the number of found rows, not the number
of affected rows CLIENT_NO_SCHEMA
I've never tested this myself ...
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26 E4 EC 80 58 7B 31 3A D7