Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在我的脚本mysqli_query()中显示此错误:无法获取mysqli_Php_Mysqli - Fatal编程技术网

Php 在我的脚本mysqli_query()中显示此错误:无法获取mysqli

Php 在我的脚本mysqli_query()中显示此错误:无法获取mysqli,php,mysqli,Php,Mysqli,$query2=Select*从$bust中选择,其中status='Available'和state='choice'限制为0,$seat $con=mysqli_connect($hostname,$username,$password,$database); if(isset($_SESSION['id'])) { include("config.php"); $uid = $_SESSION['id']; $bus = $_GET['bus']; $sea

$query2=Select*从$bust中选择,其中status='Available'和state='choice'限制为0,$seat

$con=mysqli_connect($hostname,$username,$password,$database);


 if(isset($_SESSION['id']))



{


include("config.php");



$uid = $_SESSION['id'];



$bus = $_GET['bus'];


$seat = $_GET['seat'];


$choice = $_GET['choice'];


$bust = $bus.'bus';


$date = date("Y-m-d"); 


 $query = mysqli_query($con,"Select * from bus where id ='$bus'");

 if($query){


    $re1 = mysqli_fetch_array($query);


        $bus_name = $re1['bus_name'];


        $from = $re1['from_stop'];


        $to = $re1['to_stop'];


        $dept_time = $re1['dept_time'];


        $arrival_time = $re1['arrival_time'];


        $distance = $re1['distance'];


        $fare = $re1['fare'];

}


    if($choice !='')


{


        if($choice=='W' && $seat==1)
{
}

{

到站、预定日期、座位号、部门时间、距离、车费

     $id = $r['id'];

      $q3 = mysqli_query($con,"update $bust set status ='Booked' where id='$id'");

         $q4 = mysqli_query($con,"insert into user_history(user_id, bus_id,bus_name, from_stop , 
“$dept_time.”、“$distance.”、“$fare.”

 values('".$uid."','".$bus."','".$bus_name."', '".$from."', '".$to."', '".$date."', '".$id."', 

我们应该认真对待这件事吗?@IgnacioVazquez Abrams我们已经击败了成功编辑它的人注意:未定义索引:在第12行的D:\xampp\htdocs\my bus ticket reservation system\booked.php中注意:未定义索引:在第13行的D:\xampp\htdocs\my bus ticket reservation system\booked.php中注意:未定义索引:在第14行的D:\xampp\htdocs\my bus ticket reservation system\booked.php中选择警告:mysqli\u查询:无法在第17行的D:\xampp\htdocs\my bus ticket reservation system\booked.php中获取mysqli
   if($re>=$seat)
{

     while($r = mysqli_fetch_array($p))
     $id = $r['id'];

      $q3 = mysqli_query($con,"update $bust set status ='Booked' where id='$id'");

         $q4 = mysqli_query($con,"insert into user_history(user_id, bus_id,bus_name, from_stop , 
 values('".$uid."','".$bus."','".$bus_name."', '".$from."', '".$to."', '".$date."', '".$id."', 
    }


?>
         <script>