louis_coetzee Posted July 5, 2011 Share Posted July 5, 2011 I am dynamically populating dropdown boxes with php, it starts from 0. Mysql starts incrementing the id from 1. So that when I for example create a user and he selects say option 0 (South Africa) from the dropdown that it is referring to option 0 in my mysql table instead of 1. How can I fix this, so that mysql starts counting from 0 also? Please help. Quote Link to comment https://forums.phpfreaks.com/topic/241119-please-just-read-i-do-not-know-what-to-put-in-here/ Share on other sites More sharing options...
TeNDoLLA Posted July 5, 2011 Share Posted July 5, 2011 Is this dropdown data coming from db? If it is, use the corresponding ID's in the options as they are in the database. Quote Link to comment https://forums.phpfreaks.com/topic/241119-please-just-read-i-do-not-know-what-to-put-in-here/#findComment-1238468 Share on other sites More sharing options...
louis_coetzee Posted July 5, 2011 Author Share Posted July 5, 2011 Yes it is, using codeigniter framework, seems like they automatically let it count from 0, no matter what. Quote Link to comment https://forums.phpfreaks.com/topic/241119-please-just-read-i-do-not-know-what-to-put-in-here/#findComment-1238471 Share on other sites More sharing options...
TeNDoLLA Posted July 5, 2011 Share Posted July 5, 2011 Not really familiar with codeigniter, or neither can help without seeing any code. Quote Link to comment https://forums.phpfreaks.com/topic/241119-please-just-read-i-do-not-know-what-to-put-in-here/#findComment-1238472 Share on other sites More sharing options...
louis_coetzee Posted July 5, 2011 Author Share Posted July 5, 2011 Okay, cool. got the solution -> Downloaded helper for CI. thanks any way. Quote Link to comment https://forums.phpfreaks.com/topic/241119-please-just-read-i-do-not-know-what-to-put-in-here/#findComment-1238473 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.