I need to design a hiscores system for a game. I have the user data stored like this:
userid, player_rights, level, 0, 1, 2, 3,4 .. etc
where 0-4 are skill IDs. I started using prepared statements more often recently, and I know that you usually have to bind the parameters after you execute the statement. There are about 26 fields and binding each one of them can’t be the only way to do it. I have no problem with using mysqli objects for this – just wanted to know if there was a way to do it with prepared statements that didn’t required binding all of the fields.
Luckily, one of the things you can do is pass the values through an array to execute().
It does depend though on what type of access method you are using, ie PDO, MySQLi, etc.. as the value passing to execute is slightly different.