【发布时间】:2017-06-11 13:36:39
【问题描述】:
我正在使用 Mysql (phpmyadmin) 和 php,我有两个表 table1(id,name) 和 table2(id,date,name)
现在我想将 table1 的所有行复制到 table2 并且在 table2 中的日期列中应该存储系统的当前日期,因为我正在尝试以下查询,它给出了错误
'INSERT INTO table2 (id, Date, name)SELECT id,'.date("Y-m-d",mktime()).'nae FROM table1 WHERE id=2'
你能纠正我的问题吗?我尝试了不同的方法,但没有使用任何方法。与数据库连接没有错误一切正常,我测试了连接它的罚款
【问题讨论】: