• Notice regarding image hosts and attachments. See here.

Whats wrong?

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.
 
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 :/
 
Back
Top Bottom