$customernumber = mysqli_query($dbconnect,"SELECT CustomerNumber FROM Registration WHERE Name='$name'" );
if (!mysqli_query($dbconnect, $sql)) {
die('Error: '. mysqli_error($dbconnect));
}
echo "<p>Dear $name, you are successfully registered into ShipOnline, and your customer number is $customernumber, which will be used to get into the system.</p>";
mysqli_close($dbconnect);
客户编号未显示,我该如何解决此问题?
感谢
答案 0 :(得分:1)
您需要使用fetch
来检索DB
的记录。试试如下
$customernumber = mysqli_query($dbconnect,"SELECT CustomerNumber as cus_no FROM Registration WHERE Name='$name'" );
if (!mysqli_query($dbconnect, $sql)) {
die('Error: '. mysqli_error($dbconnect));
}
while($row = mysqli_fetch_assoc($customernumber)) {
$customer_number = $row['cus_no'];
}
echo "<p>Dear $name, you are successfully registered into ShipOnline, and your customer number is $customer_number, which will be used to get into the system.</p>";
mysqli_close($dbconnect);