Getting data on last INSERTed row

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

I'm wondering if there's an easy and non-system-demanding way to get data on
an INSERTed row in PHP/MySQL?

Specifically, I want the value of an auto-incremented primary key cell,
"uid". I'm INSERTing a new person into a table, and need to return this
value to a Javascript function that maintains an array of all persons in
this table. I want to avoid a full SELECT query that would rebuild the array
from scratch and put unnessecary load on the SQL server.

I first thought of mysql_affected_rows, but as far as I can read, it only
returns the value of rows affected, i.e. 1 on any INSERT statement executed?

Any ideas?

Thank you,
Daniel




-- 
There are 10 kinds of people: Those who know binary and those who don't.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux