Reputation: 3
How can I add a column to only a specific user. if for an example i would like to add a new column but only to id 3.
Here is the code that i'm using:
$add = "ALTER TABLE $db_chest_name ADD kg_$countt INT(11) NOT NULL WHERE id='$myid'";
mysql_query($add) or die ('could not alter ' . mysql_error());
Upvotes: 0
Views: 30
Reputation: 28763
ALTER
by default will add the column to the table not corresponding with the rows.If you want you can implement the logic on creating a column with default value and update it for the user whom you want.
Upvotes: 1