$public_prod_id = 'C'.rand(1000000000,9999999999); $_SESSION['public_prod_id'] = $public_prod_id; $exist = mysqli_num_rows($pdo->query( "SELECT * FROM `product`
WHERE `public_prod_id` = '{$_SESSION['public_prod_id']}' "
));if($exist == 0){
$pdo->query(
"INSERT INTO ``
( ``
) VALUES
( '{}'
) "
);
}如果找到的結果是大於0那我如何回到上面再產生一組新的號碼,然後再重新走一次?
添加回答
举报
0/150
提交
取消