# 2 short mysql/php questions :)

**URL:** <https://forum.kirupa.com/t/2-short-mysql-php-questions/240272>\
**Category:** programming\
**Created:** [October 1, 2007, 2:46pm UTC](https://forum.kirupa.com/t/2-short-mysql-php-questions/240272 "2007-10-01T14:46:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nevo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nevo/32/3473_2.png) [@Nevo](https://forum.kirupa.com/u/Nevo)\
**Post date:** [October 1, 2007, 2:46pm UTC](https://forum.kirupa.com/t/2-short-mysql-php-questions/240272/1 "2007-10-01T14:46:37Z")

</div>

Hi

Two questions for a php/mysql guru out there 🙂

I need to do two (probably very basic things)  
First off after running a query to update multiple lines how would you retrieve how many liens that query effected ? Say you had a column called “name” and you wanted to change all the rows that are currently Dave to Laura how would you find after how many were changed?

Secondly after adding a row to a table with auto increment on a ID field, what would be the easiest way to retrieve the new ID. (assuming some rows may have been previously so count(\*) would not give the correct figure but I’m assuming there is a much less painful method on mysql anyway 🙂

Thanks in advance,  
Oli
