coder9 Posted July 27, 2008 Share Posted July 27, 2008 hello i have this code below. $query = "INSERT INTO jwinners (gsid, game_no) VALUES (1,'.$current_game_no.')"; I'm a little confused and don't know exactly what value to put on a column that has auto increment (index). notice that gsid is an auto increment column. I wonder what is the right syntax for the INSERTion? i just put the 1 value into gsid column. and it generated an error. since gsid is auto increment column, i don't know what to put. Thank you. Link to comment https://forums.phpfreaks.com/topic/116788-solved-what-should-i-put-on-auto-increment-column/ Share on other sites More sharing options...
MasterACE14 Posted July 27, 2008 Share Posted July 27, 2008 the gsid . The ID column. ACE Link to comment https://forums.phpfreaks.com/topic/116788-solved-what-should-i-put-on-auto-increment-column/#findComment-600575 Share on other sites More sharing options...
DarkWater Posted July 27, 2008 Share Posted July 27, 2008 You don't put anything into that column. $sql = "INSERT INTO jwinners (game_no) VALUES ('$current_game_no')"; Link to comment https://forums.phpfreaks.com/topic/116788-solved-what-should-i-put-on-auto-increment-column/#findComment-600576 Share on other sites More sharing options...
coder9 Posted July 27, 2008 Author Share Posted July 27, 2008 the gsid . The ID column. ACE Yes, exactly. that is the ID column. Link to comment https://forums.phpfreaks.com/topic/116788-solved-what-should-i-put-on-auto-increment-column/#findComment-600577 Share on other sites More sharing options...
coder9 Posted July 27, 2008 Author Share Posted July 27, 2008 You don't put anything into that column. $sql = "INSERT INTO jwinners (game_no) VALUES ('$current_game_no')"; @DarkWater Thank you! Link to comment https://forums.phpfreaks.com/topic/116788-solved-what-should-i-put-on-auto-increment-column/#findComment-600579 Share on other sites More sharing options...
MasterACE14 Posted July 27, 2008 Share Posted July 27, 2008 the gsid . The ID column. ACE Yes, exactly. that is the ID column. in saying that you could make either one the auto increment column. But if you wish to insert the game number manually. Then its fine how it is. Link to comment https://forums.phpfreaks.com/topic/116788-solved-what-should-i-put-on-auto-increment-column/#findComment-600581 Share on other sites More sharing options...
DarkWater Posted July 27, 2008 Share Posted July 27, 2008 You don't put anything into that column. $sql = "INSERT INTO jwinners (game_no) VALUES ('$current_game_no')"; @DarkWater Thank you! No problem, please mark this topic as solved. Link to comment https://forums.phpfreaks.com/topic/116788-solved-what-should-i-put-on-auto-increment-column/#findComment-600584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.