【发布时间】:2014-06-19 01:56:05
【问题描述】:
这是我的问题。
我在 tsql 中尝试 bindparam 但没有发生。
$sql="INSERT INTO `digishop`.`sell_table` (`Id`, `Time`, `GroupId`, `Amount`, `ProductId`) VALUES ('11', ':time', ':groupid', '1000', '1');";
$doer = new doer();
$doer->ping();
$result=$doer->temp->prepare($sql);
$temp=1;
$result->bindparam(':time',$temp);
$temp1=1450;
$result->bindparam(':groupid',$temp);
$doer->temp=$result;
但在数据库中:
Full texts Id Time GroupId Amount ProductId
11 0 :goroid 1000 1
见:D 我该如何解决这个问题?
【问题讨论】:
-
去掉
':time', ':goroid',的引号 -
我使用 pdo 并非不可能
-
PDO 默认不报错。你的未公开班级会处理这个问题吗?
-
未报告任何错误且查询工作但 bindparm 不起作用
-
我不敢相信。您正在绑定不存在的参数(正如 Fred 指出的那样)。你应该得到一个错误。
标签: php pdo sqlbindparameter