Hey guys, a bit of a joint post with MySQL, but I though I'd try here first.
I am planning on making an online game, but there will be different ages. So my first will be Age 0 (a0) and second Age 1 (a1) etc...
Creating the tables like "a0_user_in fo" will be easy, but I would like to have one registration form, so that you can choose which age you are registering with. The problem comes when I am inserting the submitted data into the correct tables:
[PHP]mysql_query("IN SERT INTO user_info(user_ name)
VALUES('$submit ted_name')")
or die(mysql_error ());[/PHP]
I would like to have something like:
[PHP]mysql_query("IN SERT INTO $age.'_user_inf o'(user_name)
VALUES('$submit ted_name')")
or die(mysql_error ());[/PHP]
Which should submit the data to table a0_user_info in the case of the user registering to Age 0. So is that INSERT INTO syntax possible? It doesn't work, so I am not too confident.
I might have to make new variables where I join the strings prior to calling them from the database with a new variable, but I would prefer not to and figure out the syntax to do it in one line like I've tried above.
I am planning on making an online game, but there will be different ages. So my first will be Age 0 (a0) and second Age 1 (a1) etc...
Creating the tables like "a0_user_in fo" will be easy, but I would like to have one registration form, so that you can choose which age you are registering with. The problem comes when I am inserting the submitted data into the correct tables:
[PHP]mysql_query("IN SERT INTO user_info(user_ name)
VALUES('$submit ted_name')")
or die(mysql_error ());[/PHP]
I would like to have something like:
[PHP]mysql_query("IN SERT INTO $age.'_user_inf o'(user_name)
VALUES('$submit ted_name')")
or die(mysql_error ());[/PHP]
Which should submit the data to table a0_user_info in the case of the user registering to Age 0. So is that INSERT INTO syntax possible? It doesn't work, so I am not too confident.
I might have to make new variables where I join the strings prior to calling them from the database with a new variable, but I would prefer not to and figure out the syntax to do it in one line like I've tried above.
Comment