【发布时间】:2018-08-13 12:23:56
【问题描述】:
当我在 phpMyAdmin(SQL 选项卡)中像这样调用过程时,它可以工作:
CALL `test_discount`('022979', 1101, 1, 'W', 100, @p5); SELECT @p5 AS `discount`;
但是,当我像这样在PHP 中调用它时:
$res = $conn->query("CALL `test_discount`('022979', 1101, 1, 'W', 100, @p5); SELECT @p5 AS `discount`;");
我收到语法错误:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT @p5 AS discount' at line 1
如何让它在 PHP 中工作?
【问题讨论】:
-
@p5); -
@FunkFortyNiner 同样的问题。
SELECT @p5 AS discount附近的语法错误...
标签: php mysql sql stored-procedures mysqli