基本上我要做的是运行一个 sql 语句,将查询结果的选择部分插入到最近创建的表中。我用mysql对其进行了测试并运行了这一行
INSERT INTO searched(imagetargetpath, gamename, gamedirectory, `like`, dislike)
SELECT imagetargetpath, gamename, gamedirectory, `like`, dislike
FROM boardgamelist
WHERE gamename LIKE '%david%'
成功运行,但是当我从 phpmyadmin 提供的内容中将同一行放入 php 时,mysql_query 似乎没有运行
$sql = "INSERT INTO searched(imagetargetpath, gamename, gamedirectory,
`like`, dislike) \n"
. "SELECT imagetargetpath, gamename, gamedirectory, `like`, dislike\n"
. "FROM boardgamelist\n"
. "WHERE gamename LIKE \'%david%\'";
//copies query
$copy_query = mysql_query($sql);
以前在我的代码中但是我确实有一个创建表“搜索”的mysql命令(确认工作)我忘记了如何处理不允许它运行的mysql命令?