所以我一直在查看这段代码已经持续了好几个月并且得到了错误mysqli_bind_param()
致命错误并假设某个变量丢失或者有什么人可以提供任何帮助吗?
public function getItems_paged($startIndex, $numItems) {
$stmt = mysqli_prepare($this->connection, "SELECT clients.id, clients.fname, clients.lname, clients.sex, clients.country, clients.town, clients.dateofbirth, clients.monthofbirth, clients.yearofbirth
FROM clients
ORDER BY id DESC LIMIT ?, ?");
$this->throwExceptionOnError();
mysqli_bind_param($stmt, 'ii', $startIndex, $numItems);
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$rows = array();
mysqli_stmt_bind_result($stmt, $row->id,$row->fname,$row->lname,$row->sex,$row->country,$row->town,$row->dateofbirth,$row->monthofbirth,$row->yearofbirth);
while (mysqli_stmt_fetch($stmt)) {
$row->fname = ucfirst(substr($row->fname,0,1));
$row->lname = ucfirst($row->lname);
$row->town = ucfirst($row->town);
$row->lname = (($row->fname) . " " . ($row->lname));
$row->yearofbirth = GetAge($row->dateofbirth. '-' .$row->monthofbirth. '-' .$row->yearofbirth);
$row->Pic_loc = "";
$row->Pic_loc= "IMAGES/".($row->id)."/image01.jpg";
$rows[] = $row;
$row = new stdClass();
mysqli_stmt_bind_result($stmt, $row->id,$row->fname,$row->lname,$row->sex,$row->country,$row->town,$row->dateofbirth,$row->monthofbirth,$row->yearofbirth);
}
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
return $rows;
}