php - can you help me with these sql problem? -


hi using phpmyadmin 3.3.9 . have sql prblem in dont know problem @ all..

heres code looks like:

create table metars( metar varchar( 255 ) not null default '', timestamp timestamp( 14 ) not null , station varchar( 4 ) not null, primary key ( station ) , unique key station( station ) ) engine = myisam  

and heres error:

#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '( 14 ) not null , station varchar( 4 ) not null default '', primary ke' @ line 3 

try timestamp timestamp not null ,
there's no length/format option timestamp (that is: not mysql 5.1, see ypercube's comment)

see http://dev.mysql.com/doc/refman/5.1/en/create-table.html

data_type:     bit[(length)]   | tinyint[(length)] [unsigned] [zerofill]   | smallint[(length)] [unsigned] [zerofill]   | mediumint[(length)] [unsigned] [zerofill]   | int[(length)] [unsigned] [zerofill]   | integer[(length)] [unsigned] [zerofill]   | bigint[(length)] [unsigned] [zerofill]   | real[(length,decimals)] [unsigned] [zerofill]   | double[(length,decimals)] [unsigned] [zerofill]   | float[(length,decimals)] [unsigned] [zerofill]   | decimal[(length[,decimals])] [unsigned] [zerofill]   | numeric[(length[,decimals])] [unsigned] [zerofill]   | date   | time   | timestamp   | datetime   | year   | char[(length)]  [...]

but i'd avoid using keywords and/or type names identifiers.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -