liangxm 发表于 2014-1-14 14:32:45

mysql操作咨询

本帖最后由 liangxm 于 2014-1-14 14:33 编辑

$query = "load data local infile 'E:\df\test.sql' into table test.test;"
;~                                 $query = "use test;source 'E:\df\test.sql'"
;~                 $query = "drop database test"
      _MySQL_Real_Query($MysqlConn, $query)

为啥source 或者 load data都导入不了数据呢?drop database是可以的。


CREATE TABLE `test` (
`TimeDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Name` text NOT NULL,
`My` text NOT NULL,
`IDname` text NOT NULL,
`User` text NOT NULL,
`Code` text NOT NULL,
`Result` text NOT NULL,
`Time1` text NOT NULL,
`Time2` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8

test.sql:
insert into test (TimeDate,Name,My,IDname,User,Code,Result,Time1,Time2) VALUES (NOW(),"00:F0:00:FF:00:FF","1","2","3","4","5","6","7");

liangxm 发表于 2014-1-15 15:07:18

加入报错信息,搞定了,是格式问题

$query = "load data local infile " & _
                        "'E:\\df\\test.txt'" & _
                        " into table test.test;"

liangxm 发表于 2014-1-15 17:06:42

source的还一直没有试出来。。。
页: [1]
查看完整版本: mysql操作咨询