$query33=mysql_query("SELECT * FROM order_payment_tb where order_status='Success'",$conn) or die (mysql_error());
while($row33=mysql_fetch_array($query33)) {
$query3=mysql_query("SELECT * FROM user_order_tb where status='Pending' and order_id='".$row33['order_id']."'",$conn) or die (mysql_error());
$count5=mysql_num_rows($query3);
{
echo $count5; ?>
<?php
}
}
?>
我的mysql結果數據是0111,我想顯示數據爲3即(0 + 1 + 1 + 1 = 3) 。 請幫助如何計算0111爲0 + 1 + 1 + 1 = 3在php中
瞭解有關JOIN的內容。並停止使用PHP的棄用mysql_ API。 – Strawberry
像這樣:'echo 0 + 1 + 1 + 1;' –
**警告**您的代碼容易受到sql注入攻擊 –