29 Jun 2007 at 02:56 #1 The_KiD The_KiD Permabanned Joined 19 Apr 2006 Posts 2,333 Location West Yorkshire Is anyone awake who can tell me what is wrong here: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD ' . $game_id . ' VARCHAR( 20 ) NULL"); I know $game_id has a value so that shouldnt be a problem.
Is anyone awake who can tell me what is wrong here: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD ' . $game_id . ' VARCHAR( 20 ) NULL"); I know $game_id has a value so that shouldnt be a problem.
29 Jun 2007 at 03:20 #2 Jaffa_Cake Jaffa_Cake Associate Joined 9 Oct 2006 Posts 1,945 Location Location Location! The_KiD said: Is anyone awake who can tell me what is wrong here: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD ' . $game_id . ' VARCHAR( 20 ) NULL"); I know $game_id has a value so that shouldnt be a problem. Click to expand... try Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD `' . $game_id . '` VARCHAR( 20 ) NULL");
The_KiD said: Is anyone awake who can tell me what is wrong here: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD ' . $game_id . ' VARCHAR( 20 ) NULL"); I know $game_id has a value so that shouldnt be a problem. Click to expand... try Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD `' . $game_id . '` VARCHAR( 20 ) NULL");
29 Jun 2007 at 03:29 #3 The_KiD The_KiD Permabanned OP Joined 19 Apr 2006 Posts 2,333 Location West Yorkshire Thanks Jaffa, although i just got it after I posted. Thanks for help though Here's how it worked: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD `$game_id` VARCHAR(20)"); Any idea how i give it a default value though? I tried: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD `$game_id` VARCHAR(20) SET DEFAULT(0) "); and mysql_query("ALTER TABLE h2h_gamesplayed ADD `$game_id` VARCHAR(20) SET DEFAULT `0` "); neither of which worked :/
Thanks Jaffa, although i just got it after I posted. Thanks for help though Here's how it worked: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD `$game_id` VARCHAR(20)"); Any idea how i give it a default value though? I tried: Code: mysql_query("ALTER TABLE h2h_gamesplayed ADD `$game_id` VARCHAR(20) SET DEFAULT(0) "); and mysql_query("ALTER TABLE h2h_gamesplayed ADD `$game_id` VARCHAR(20) SET DEFAULT `0` "); neither of which worked :/