mysql_insert_id
Posted: Thu Jul 11, 2002 1:29 pm
howdy all,
im trying to configure a php forum to work with a portal system I built. The problem I am having is when a user replies to a post, it inserts the post data into the posts table then it will grab the last autonumber id, which is the postifd, by using the mysql_insert_id function and insert it into other tables such as the posts_text table. The problem is, and I don't know how this happened, but the autonumber will generate a number like 6, but the mysql_insert_id will return a number like 2453. Maybe Im just missing something but I know how I can get around the problem - just by quering the database for the newest postid and get it that way, but it isnt as efficient. Any help would be greatly appreciated. Thanks
im trying to configure a php forum to work with a portal system I built. The problem I am having is when a user replies to a post, it inserts the post data into the posts table then it will grab the last autonumber id, which is the postifd, by using the mysql_insert_id function and insert it into other tables such as the posts_text table. The problem is, and I don't know how this happened, but the autonumber will generate a number like 6, but the mysql_insert_id will return a number like 2453. Maybe Im just missing something but I know how I can get around the problem - just by quering the database for the newest postid and get it that way, but it isnt as efficient. Any help would be greatly appreciated. Thanks