本文介绍了我不能显示第二个表,当我用不同的数据更改第二个表但没有显示任何错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$dep_re = $_POST['dpt_from'];
$arive_re = $_POST['arive_to'];
$day_re = $_POST['day_re'];
$month_re = $_POST['month_re'];
$year_re = $_POST['year_re'];
$time_re = $_POST['time_re'];
$adult_re = $_POST['no_of_pax_adult'];
$child_re = $_POST['no_of_pax_child'];
$date_re = "$year_re-$month_re-$day_re";
$connectSQL = mysql_connect("localhost","root","");
if (!$connectSQL)
die("Database Not Found".mysql_error());
$connectSelectdb = mysql_select_db("bobdatabse");
if (!$connectSelectdb)
die("Error connect to database".mysql_error());
else{
$query = "SELECT * FROM trip_info WHERE date='$date' AND time='$time' AND depart='$dep' AND arive='$arive'";
//$query_re = "SELECT * FROM round_trip_info WHERE date_re='$date_re' AND time_re='$time_re' AND depart_re='$dep_re' AND arive_re='$arive_re'";
$result = mysql_query($query);
//$result_re = mysql_query($query_re);
if(!$result)
die("invalid query!".mysql_error());
else
echo "<form name=listtrip method=post action=Reservation.php>";
echo "<b>$dep</b> to <b>$arive</b>";
echo "<table border=1px>";
echo "<tr><td>Date</td><td>Time</td><td>Departure</td><td>Arive</td><td>Price Adult</td><td>Price Child</td><td></td></tr>";
while($row=mysql_fetch_array($result))
{
echo "<tr><td>".$row['date']."</td><td>".$row['time']."</td><td>".$row['depart']."</td><td>".$row['arive']."</td><td>".$row['adult']." x ".$adult."=".$row['adult'] * $adult."</td><td>".$row['child']." x ".$child."=".$row['child'] * $child."</td><td><input type=submit value=Booking Now></td></tr>";
}
echo "</table><br>";
$connectSQL = mysql_connect("localhost","root","");
if (!$connectSQL)
die("Database Not Found".mysql_error());
$connectSelectdb = mysql_select_db("bobdatabse");
if (!$connectSelectdb)
die("Error connect to database".mysql_error());
else{
$query_re = "SELECT * FROM round_trip_info WHERE date_re='$date_re' AND time_re='$time_re' AND depart_re='$dep_re' AND arive_re='$arive_re'";
$result_re = mysql_query($query_re);
if(!$query_re)
die("invalid query!".mysql_error());
echo "<form name=listtrip method=post action=Reservation.php>";
echo "<b>$arive</b> to <b>$dep</b>";
echo "<table border=1px>";
echo "<tr><td>Date</td><td>Time</td><td>Departure</td><td>Arive</td><td>Price Adult</td><td>Price Child</td><td></td></tr>";
while($row_re = mysql_fetch_array($result_re,MYSQL_BOTH))
{
echo "<tr><td>".$row_re['date_re']."</td><td>".$row_re['time_re']."</td><td>".$row_re['depart_re']."</td><td>".$row_re['arive_re']."</td><td>".$row_re['adult_re']." x ".$adult_re."=".$row_re['adult_re'] * $adult_re."</td><td>".$row_re['child_re']." x ".$child_re."=".$row_re['child_re'] * $child_re."</td><td><input type=submit value=Booking Now></td></tr>";
}
echo "</table>";
}
}
推荐答案
这篇关于我不能显示第二个表,当我用不同的数据更改第二个表但没有显示任何错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!