@NutterMar 04.2005 — #What about [url=http://us2.php.net/mysql_affected_rows]mysql_affected_rows()[/url]? I've never used it, but it appears to do what you're asking.
@NutterMar 04.2005 — #But, mysql_num_rows() only applies to SELECT queries, correct? I think, and may be wrong, that he's asking about how to tell how many rows are affected by an UPDATE query.
Just to make sure I'm reading your question right:
You're trying to run the "UPDATE..." query and want to know how many records are updated, correct?
@NutterMar 04.2005 — #What database server are you using, and what version? NogDog's second suggestion would only work in MySQL 4.1 or greater b/c of subquery support. I don't know about other DB servers.
@NogDogMar 04.2005 — #[i]Originally posted by Nutter [/i]
[B]Did mysql_affected_rows() give you anything? [/B][/QUOTE] It should. Per the [url=http://us3.php.net/mysql-query]mysql_query() documentation[/url] (always a good place to start): Use mysql_num_rows() to find out how many rows were returned for a SELECT statement or mysql_affected_rows() to find out how many rows were affected by a DELETE, INSERT, REPLACE, or UPDATE statement.[/quote]