#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(14), -


creating search engine website of sphider

but when creating mysql database tables following error message showed

error sql query:

create table query_log ( query varchar(255), time timestamp(14), elapsed float(2), results int) 

mysql said: documentation

#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '(14), elapsed float(2), results int)' @ line 3

the problem lies number following timestamp declaration. mysql documentation says of timestamp type:

the display width fixed @ 19 characters, , format 'yyyy-mm-dd hh:mm:ss'.

so, code can fixed making following modification:

create table query_log (     query varchar(255),     time timestamp,     elapsed float(2),     results int ) 

as far number "14" goes, it's unclear going that. project working on require timestamp of specific length? if so, might best use data type, or convert timestamp desired format after pulled database.

i new on stackexchange, hope i've adequately answered question. please let me know if can else!


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -