当您的结果不是结果(而是“ false”)时,就会发生这种情况。您应该更改此行
$sql = 'SELECt * FROM $usertable WHERe PartNumber = $partid';
对此:
$sql = "SELECt * FROM $usertable WHERe PartNumber = $partid";
适用于整数(数字),对于字符串,您需要将$ variable放在单引号中,例如
$sql = "SELECt * FROM $usertable WHERe PartNumber = '$partid' ";
如果要/必须使用单引号,则php无法解释变量,则必须这样做:
$sql = 'SELECt * FROM '.$usertable.' WHERe string_column = "'.$string.'" AND integer_column = '.$number.';
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)