duandong2562 2017-06-06 06:06
浏览 27
已采纳

为什么phpMyAdmin不导入我的表? [关闭]

I'm a designer, but as there's no programmer in my company I have to start studing programming. Which I did only somedays ago (and I have only a html and css knowledge background) so pleasepleaseplease don't take any knowledge for granted if you can answer me!

I'm studing PHP and MySQL using "PHP & MySQL in easy steps" by Mike McGranth (if any of you have it I'm at page 90/91). So, the task is simple: write a .sql file and create a table in phpMyAdmin with it.
Since it's an exercise from a book I just have to write as it's written on the page and test it; yes, I have the solution-file too, but the point is I can't see the difference between my code, which can't be processed by phpMyAdmin, and the solution-code, which gives no problem.

The .sql file written by me is this:

CREATE TABLE IF NOT EXISTS products
(
id INT UNIQUE AUTO_INCREMENT ,
code INT NOT_NULL ,
name VARCHAR(25) NOT NULL ,
quantity INT DEFAULT 1 NULL ,
price DECIMAL(6,2) NOT NULL
) ;

And the solution-file code is this:

CREATE TABLE IF NOT EXISTS products
(
  id        INT UNIQUE  AUTO_INCREMENT ,
  code      INT     NOT NULL ,
  name      VARCHAR(25)     NOT NULL ,
  quantity  INT     DEFAULT 1 NULL , 
  price     DECIMAL(6,2)    NOT NULL
) ;

This is also how the look like in a code-editor program: enter image description here

This is the error that phpMyAdmin gives to me (if the japanese part is important I can add the translation): enter image description here

Since I have a solution, why do I ask? Because maybe I've done just a small mistake, but if I don't understand it I'm afraid to do it again when handling bigger files, maybe a client db, real work, not just an exercise. So, if anyone will be so kind to explain it to me he/she will have my ethernal gratitude!

  • 写回答

3条回答 默认 最新

  • dongliantong3229 2017-06-06 06:09
    关注

    update this cause NOT_NULL is not correct

    code INT NOT_NULL ,
    

    to

    code INT NOT NULL ,
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向