Problem creating decimal type column

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Mayor McCheese
Forum Newbie
Posts: 5
Joined: Tue Apr 23, 2002 12:17 am

Problem creating decimal type column

Post 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;
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post 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" .
Post Reply