Page 1 of 1

Problem creating decimal type column

Posted: Wed Aug 07, 2002 3:28 pm
by Mayor McCheese
Hi All,

I was wondering if anyone could tell me what is wrong with the following attempt to add a column of decimal type to an existing table...no matter how many different ways I slice/dice the query, MySQL spits back a syntax error from both the command line and going through PhpMyAdmin.

Thanks in advance,

Pat

ALTER TABLE databasename.players ADD average DECIMAL(10) UNSIGNED NOT NULL;

Posted: Wed Aug 07, 2002 4:22 pm
by RandomEngy
Ahh simple. You don't need the databasename in there. You need to select that using a function like mysql_select_db() , not in the query. The database interprets name1.name2 as field "name2" of table "name1" , not table "name2" of database "name1" .