lJesterl Posted November 18, 2006 Share Posted November 18, 2006 I dont know exactly how i should go about this.When my script creates a tournament it gets assigned an id in the mysql table.I also need it to insert what tid it was assigned into another table.Basicly something like this.$lasttid=("SELECT tid FROM tourneys "THIS IS WHERE I NEED THE HELP"mysql_query("INSERT INTO debrackets SET tid='$lasttid'");I need it to get the last entry into touneys for tid, or i need it to get the highest number tid.Any Suggestions? Link to comment https://forums.phpfreaks.com/topic/27670-help-please/ Share on other sites More sharing options...
fiddy Posted November 18, 2006 Share Posted November 18, 2006 If my understanding is correct..Please user mysql_insert_id() function after you have executed the insert query. This functiom returnes the last inserted ID. Link to comment https://forums.phpfreaks.com/topic/27670-help-please/#findComment-126567 Share on other sites More sharing options...
lJesterl Posted November 18, 2006 Author Share Posted November 18, 2006 im not exactly following u, im so sorry Link to comment https://forums.phpfreaks.com/topic/27670-help-please/#findComment-126568 Share on other sites More sharing options...
lJesterl Posted November 18, 2006 Author Share Posted November 18, 2006 i got it, thank you very much, omg thank you$lasttid=mysql_insert_id();mysql_query("INSERT INTO debrackets SET tid='$lasttid'"); Link to comment https://forums.phpfreaks.com/topic/27670-help-please/#findComment-126569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.