第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

我如何將 mysqli_expects 參數(shù) 1 修復(fù)為給定的 mysqli_result 字符串

我如何將 mysqli_expects 參數(shù) 1 修復(fù)為給定的 mysqli_result 字符串

PHP
蕭十郎 2023-07-21 18:25:38
當(dāng)我嘗試執(zhí)行查詢并獲取行數(shù)時(shí),會(huì)生成錯(cuò)誤。我已經(jīng)嘗試解決這個(gè)問題好幾天了,而且我是 php 新手,所以它可能甚至不是語法問題。  <?php  // error_reporting(0);  $flying_from = "";  $flying_to = "";  $departure_date = "";  $return_date = "";  $number_of_adults = "";  $number_of_children = "";  $flight_class = "";  // Connect to database  $conn = mysqli_connect('localhost', 'presh', '1234', 'saffron');  if (isset($_GET['submit'])) {    $flying_from = $_GET['flying_from'];    $flying_to = $_GET['flying_to'];    $departure_date = $_GET['departure_date'];    $return_date = $_GET['return_date'];    $number_of_adults = $_GET['number_of_adults'];    $number_of_children = $_GET['number_of_children'];    $flight_class = $_GET['flight_class'];    $query = "SELECT * FROM flights WHERE flying_from LIKE $flying_from AND flying_to LIKE $flying_to AND departure_date LIKE $departure_date AND return_date LIKE $return_date AND    number_of_adults LIKE $number_of_adults AND number_of_children LIKE $number_of_children AND flight_class LIKE $flight_class";    $result = mysqli_query($conn,$query);    $count = mysqli_num_rows($result);    if($count > 0){        $output = 'There was no search results';    }else{      while ($row = mysqli_fetch_array($query)) {        $fFrom = $row['flying_from'];        $fTo = $row['flying_to'];        $dDate = $row['departure_date'];        $rDate = $row['return_date'];        $nAdults = $row['number_of_adults'];        $nChildren = $row['number_of_children'];        $fClass = $row['flight_class'];        $output .= '<div>'.$fFrom.' '.$fTo. ' '.$dDate.' '.$rDate.' '.$nAdults.' '.$nChildren.' '.$fClass.'</div>';    }  }}?>
查看完整描述

1 回答

?
寶慕林4294392

TA貢獻(xiàn)2021條經(jīng)驗(yàn) 獲得超8個(gè)贊

您需要傳遞的$result變量$query不在mysqli_fetch_array()

while ($row = mysqli_fetch_array($result)) {

}


查看完整回答
反對(duì) 回復(fù) 2023-07-21
  • 1 回答
  • 0 關(guān)注
  • 169 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)