我已经被警告消息困扰了一段时间,却无法弄清。
<a href="works.php? TotalCompletedTasks =3">Tasks under 2</a>
<?php
$stmt = $con->prepare("v.MemberID, v.VisitingNumber, count(CompletedTaskID) as TotalCompletedTasks
from Visits v join CompletedTasks c
on v.VisitingNumber = c.VisitingNumber
where TotalCompletedTasks<:TotalCompletedTasks");
$stmt->bindParam(': TotalCompletedTasks', $_GET['TotalCompletedTasks'], PDO::PARAM_INT);
$stmt->execute();
答案 0 :(得分:0)
$stmt->bindParam(': TotalCompletedTasks', $_GET['TotalCompletedTasks'], PDO::PARAM_INT);
应为:
$stmt->bindParam(':TotalCompletedTasks', $_GET['TotalCompletedTasks'], PDO::PARAM_INT);
也就是说,您的参数名称中有多余的空格。