English 中文(简体)
#1064 我方的错误 - 指定代表
原标题:#1064 mysql error - DOUBLE NOT NULL

我试图制作一张叫作 car的薄片。 I m目前通过MAMP(WAMP的Mac版本)使用Sandamyadmin。

在我点击“光子”时,这一错误似乎:

    SQL query:

CREATE TABLE `cardatabase`.`CARTABLE` (
`ID` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`SLOTNUMBER` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`STATUS` ENUM( 1 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`LATITUDE` DECIMAL( 20 ) NOT NULL ,
`LONGITUDE` DECIMAL( 20 ) NOT NULL ,
`LOCATION` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`DEVICEID` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;

MySQL said: Documentation
#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  1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `LATITUDE` DECIMAL(20) N  at line 1 

这似乎是一个双重数据类型的问题,因为当我改变数据类型,使表格制作起来时。 是否有其他办法? 事先感谢任何帮助。

最佳回答

你的问题是:

`STATUS` ENUM( 1 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,

缩略语

rel=“nofollow noreferer”>MySQL doco

“ENUM”是一个直观物体,其价值从表制作时间专栏列出的允许数值清单中选定。

点数价值必须是引出的字面;它可能不是一个表述,哪怕是评价了直观价值。

问题回答

您在直线上有错误,需要预先确定如下面值:

STATUS ENUM ( ravi , kotwani ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NUL,

全面询问:

CREATE TABLE cardatabase.CARTABLE ( ID VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , SLOTNUMBER VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , STATUS ENUM ( ravi , kotwani ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NUL, LATITUDE DECIMAL( 20 ) NOT NULL , LONGITUDE DECIMAL( 20 ) NOT NULL , LOCATION VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , DEVICEID VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签