我正在WordPress页面中使用Insert PHP插件进行一些SQL查询,但是->
对象运算符更改为->
当我在文本编辑器中编写代码或在可视化编辑器中查看时。当我执行代码时,它会说:
分析错误:语法错误,意外的“&;”在/home/content/p3pnexwpnas09\\u data03/81/2766081/html/wp content/plugins/insert php/insert\\u php中。php(48):第9行的eval()\'d代码
[insert_php]
if ( isset( $_POST[\'submit\'] ) ) {
global $wptd;
$n1 = $_POST[\'n1\'];
$n2 = $_POST[\'n2\'];
$n3 = $_POST[\'n3\'];
$n4 = $_POST[\'n4\'];
$wpdb->query( prepare(
"INSERT INTO $wpdb->communitycauses (des,city,state,date)
VALUES (%d,%s,%s)",
array (
$n1,
$n2,
$n3,
$n4
)
) );
} else {
echo "Enter the cause Please";
}
[/insert_php]