num_rows > 0) { // 输出数据 while($row = $result->fetch_assoc()) { // 获取每个字段的值 $zhutu = $row["zhutu"]; $goods = $row["name"]; $link = $row["link"]; $price =$row["price"]; $state = $row["state"]; $haokaid = $row['haokaid']; $apiType = $row['api_type']; $se_num = $row['se_num']; if ($state == 1) { // 商品已下架,弹窗提示并跳转到 index.php 页面 echo ""; exit; } } } else { echo ""; exit; } // $sql = "SELECT * FROM oder WHERE uid = $uid"; // $result = mysqli_query($con, $sql); $time = time(); $heder = 'KJKJ'; $prefix = date("Ymd"); // 获取当前日期,例如20220101 $oderid = $heder . $prefix . rand(100000, 999999); // 生成6位随机数作为订单号后缀 // echo $oderid; ?>