INSERT INTO hy_student (id, student_no, student_name, delete, sex, birthday, student_intro) VALUES (1, 454, 'ry', '0', '1', '2002-01-01', 'dsaf')

解决方案 »

  1.   

    日期的格式是有好几种但你的 "1980-06-19"是对的
    下面是mysql帮助里的.
    列类型  “零”值  
    DATETIME  '0000-00-00 00:00:00'  
    DATE  '0000-00-00'  
    TIMESTAMP  00000000000000(长度取决于显示尺寸) 
    TIME  '00:00:00'  
    YEAR  0000  
    在不行可以这样看看TO_DAYS
    INSERT INTO hy_student (id, student_no, student_name, delete, sex, birthday, student_intro) VALUES (1, 454, 'ry', '0', '1', TO_DAYS('2002-01-01'), 'dsaf')
      

  2.   

    INSERT INTO hy_student (id, student_no, student_name, delete, sex, birthday, student_intro) VALUES ('1', '454', 'ry', '0', '1', '2002-01-01', 'dsaf')
    里面birthday字段好像没有问题
    问题是
    id和student_no应该是int和bigint,所以应该是
    INSERT INTO hy_student (id, student_no, student_name, delete, sex, birthday, student_intro) VALUES (1, 454, 'ry', '0', '1', '2002-01-01', 'dsaf')
    数字字段的值不能加引号,不然就当成字符型的了
      

  3.   

    INSERT INTO hy_student (id, student_no, student_name, delete, sex, birthday, student_intro) VALUES ('', '454', 'ry', '0', '1', '2002-01-01', 'dsaf')
    auto_increment类型的子段可以不写,即可。
      

  4.   

    我在phpmyadmin里运行三位的语句,都不行,
    三位有行的吗?
    各位能不能在你们那儿建立这个表,然后调试出插入语句给我呢,
    谢谢了,各位,
    急!。
      

  5.   

    谢谢各位,可能是delete字段的原因,我改了名,就可以了,
      

  6.   

    The following words are explicitly reserved in MySQL. Most of them are forbidden by ANSI SQL92 as column and/or table names (for example, group). A few are reserved because MySQL needs them and is (currently) using a yacc parser: action  add  aggregate  all  
    alter  after  and  as  
    asc  avg  avg_row_length  auto_increment  
    between  bigint  bit  binary  
    blob  bool  both  by  
    cascade  case  char  character  
    change  check  checksum  column  
    columns  comment  constraint  create  
    cross  current_date  current_time  current_timestamp  
    data  database  databases  date  
    datetime  day  day_hour  day_minute  
    day_second  dayofmonth  dayofweek  dayofyear  
    dec  decimal  default  delayed  
    delay_key_write  delete  desc  describe  
    distinct  distinctrow  double  drop  
    end  else  escape  escaped  
    enclosed  enum  explain  exists  
    fields  file  first  float  
    float4  float8  flush  foreign  
    from  for  full  function  
    global  grant  grants  group  
    having  heap  high_priority  hour  
    hour_minute  hour_second  hosts  identified  
    ignore  in  index  infile  
    inner  insert  insert_id  int  
    integer  interval  int1  int2  
    int3  int4  int8  into  
    if  is  isam  join  
    key  keys  kill  last_insert_id  
    leading  left  length  like  
    lines  limit  load  local  
    lock  logs  long  longblob  
    longtext  low_priority  max  max_rows  
    match  mediumblob  mediumtext  mediumint  
    middleint  min_rows  minute  minute_second  
    modify  month  monthname  myisam  
    natural  numeric  no  not  
    null  on  optimize  option  
    optionally  or  order  outer  
    outfile  pack_keys  partial  password  
    precision  primary  procedure  process  
    processlist  privileges  read  real  
    references  reload  regexp  rename  
    replace  restrict  returns  revoke  
    rlike  row  rows  second  
    select  set  show  shutdown  
    smallint  soname  sql_big_tables  sql_big_selects  
    sql_low_priority_updates  sql_log_off  sql_log_update  sql_select_limit  
    sql_small_result  sql_big_result  sql_warnings  straight_join  
    starting  status  string  table  
    tables  temporary  terminated  text  
    then  time  timestamp  tinyblob  
    tinytext  tinyint  trailing  to  
    type  use  using  unique  
    unlock  unsigned  update  usage  
    values  varchar  variables  varying  
    varbinary  with  write  when  
    where  year  year_month  zerofill  The following symbols (from the table above) are disallowed by ANSI SQL but allowed by MySQL as column/table names. This is because some of these names are very natural names and a lot of people have already used them. ACTION 
    BIT 
    DATE 
    ENUM 
    NO 
    TEXT 
    TIME 
    TIMESTAMP