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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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'"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.