define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'steakhouse');
$con = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$sql1 ="SELECT r.MemberId,m.MFirstName,m.MLastName,m.MEmail,r.SeatAmount
FROM member m,reservation r
where m.MemberId=r.MemberId AND r.SeatAmount>=10'";
if ($result1 = $con->query($sql1))
{
while ($row1 = $result1->fetch_object())
{
printf('<tr><td align="center">%s</td>
<td align="center">%s %s</td>
<td align="center">%s</td>
<td align="center">%d</td> </tr> ',
$row1->MemberId,
$row1->MFirstName,
$row1->MLastName,
$row1->MEmail,
$row1->SeatAmount);
}
}
答案 0 :(得分:0)
您确定SQL查询结尾处的单引号不会导致异常吗?
$sql1 ="SELECT r.MemberId,m.MFirstName,m.MLastName,m.MEmail,r.SeatAmount
FROM member m,reservation r
where m.MemberId=r.MemberId AND r.SeatAmount>=10'";
^