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. Link to comment https://forums.phpfreaks.com/topic/116163-last_insert_id-question/ 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()"; Link to comment https://forums.phpfreaks.com/topic/116163-last_insert_id-question/#findComment-597366 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. Link to comment https://forums.phpfreaks.com/topic/116163-last_insert_id-question/#findComment-597415 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()."'"; Link to comment https://forums.phpfreaks.com/topic/116163-last_insert_id-question/#findComment-597457 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.