coder9 Posted July 23, 2008 Share Posted July 23, 2008 hi i use the LAST_INSERT_ID(), is this query correct? $query = "SELECT * FROM jtablegrid WHERE game_no = LAST_INSERT_ID()"; thank you. Quote Link to comment Share on other sites More sharing options...
Dethman Posted July 23, 2008 Share Posted July 23, 2008 $query = "SELECT * FROM jtablegrid WHERE game_no = LAST_INSERT_ID()"; should be $query = "SELECT * FROM `jtablegrid` WHERE `game_no` = LAST_INSERT_ID()"; Quote Link to comment Share on other sites More sharing options...
TempleDMDKrazd Posted July 23, 2008 Share Posted July 23, 2008 hi i use the LAST_INSERT_ID(), is this query correct? $query = "SELECT * FROM jtablegrid WHERE game_no = LAST_INSERT_ID()"; thank you. assuming jtablegrid.game_no is on auto_increment then yes, its correct. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted July 23, 2008 Share Posted July 23, 2008 What's last_insert_id(), I've never heard of it. I've heard of mysql_insert_id() though. Don't make it in uppercase as well, all lowercase. So it should be this: $query = "SELECT * FROM `jtablegrid` WHERE `game_no`='".mysql_insert_id()."'"; 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.