这是我的代码:
public function SelectSingleAccount($Id)
{
$Config = new Config();
$mysqli = $Config->OpenConnection();
$result = mysqli_query($mysqli, "CALL SelectSingleAccount", $accountId) or die("Query fail: ". mysqli_error());
$BusinessObject = new DL_Account();
$ArrayResult = $BusinessObject->CreateObjectArray($result);
return $ArrayResult;
}
在 phpmyadmin 中,我有一个名为 id 的参数。如何使用 $Id 值在代码中设置此参数?
最佳答案
存储过程参数位于查询字符串内:
$result = mysqli_query($mysqli, "CALL SelectSingleAccount($Id)");
确保 $Id
已正确清理
关于php - 使用PHP设置mysql参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27451438/