elementis0 Posted December 19, 2007 Share Posted December 19, 2007 Ok well heres my problem. I have two mysql tables.one table holds all information datathe other table holds all picture datawhen quering the tables i want to associate them by idmeaning I would like my images table id always equal the id of the information its associated with. heres my id setup:the id of the information table is set to auto incrementthe id of my images table is set to int.how can I use mysql/php to take the id that is being entered into the information table and insert that same id number for the pictures being associated with that information table? i wasnt sure whether to put this in the php or mysql forum, but seeing as php will probably be used to solve this i chose this forum. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 19, 2007 Share Posted December 19, 2007 http://www.php.net/manual/en/function.mysql-insert-id.phpMake sure you use it right after the insert, it only works with the last insert operation. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.