Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or ' with PDO
Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or ' with PDO
我正在努力创建准备好的 PDO 语句并在网站上执行它,但我收到一个解析错误:语法错误,意外的“(”,期待 T_STRING 或 T_VARIABLE或 ' 错误。请参阅下面的代码:
$STH = $DBH->('INSERT INTO model (x, y, z) values (?, ?, ?)');
$STH->bindParam(1, $x);
$STH->bindParam(2, $y);
$STH->bindParam(3, $z);
$name = $_GET['x'];
$ref_cat_id = $_REQUEST['y'];
$ref_man_id = $_REQUEST['z'];
$STH->execute();
我想你想要一个像这样的准备好的声明:
$STH = $DBH->prepare('INSERT INTO model (x, y, z) values (?, ?, ?)');
//^^^^^^^See here
我正在努力创建准备好的 PDO 语句并在网站上执行它,但我收到一个解析错误:语法错误,意外的“(”,期待 T_STRING 或 T_VARIABLE或 ' 错误。请参阅下面的代码:
$STH = $DBH->('INSERT INTO model (x, y, z) values (?, ?, ?)');
$STH->bindParam(1, $x);
$STH->bindParam(2, $y);
$STH->bindParam(3, $z);
$name = $_GET['x'];
$ref_cat_id = $_REQUEST['y'];
$ref_man_id = $_REQUEST['z'];
$STH->execute();
我想你想要一个像这样的准备好的声明:
$STH = $DBH->prepare('INSERT INTO model (x, y, z) values (?, ?, ?)');
//^^^^^^^See here