Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get the number of rows affected in mysql php
updating is affecting properly but it is not showing the number of affected rows


SQL
update user_register , comments,articles
set
user_register.locked=1,
comments.locked=1,
articles.locked=1
where
user_register.user_id=1
and
comments.user_id=1
and
articles.user_id=1
Posted

Try using ROW_COUNT()[^]
 
Share this answer
 
Comments
André Kraak 2-Dec-12 13:17pm    
My 5
__TR__ 2-Dec-12 13:20pm    
Thank you.
Try using mysql_affected_rows[^] after executing the SQL statement.
 
Share this answer
 
Comments
__TR__ 2-Dec-12 13:09pm    
My 5!
I was about to update my solution to include this option :)
André Kraak 2-Dec-12 13:17pm    
Thanks, the function is actually mentioned in your link.
__TR__ 2-Dec-12 13:21pm    
You are right. I did not observe that!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900