我在 PHP 中有代码:
<?php
// include 'connectss.php';
include 'koneksi.php';
$query= "CALL ws_booking('KLN','MDN','20131012','U15a',2,1,'A','jonie','ivhas,gavas','19900302,19901002','0815123456,08349857345','U77783,K77234','ronas','20100606','5EB9FE68-8915-11E0-BEA0-C9892766ECF2');";
//echo($query);
$hasil = mysqli_query($koneksii,$query) or die(mysqli_error($koneksii));
while($row = mysqli_fetch_row($hasil))
{
$trans_hold_id = $row[0];
}
$kueri = " SELECT 0 as err_code,a.originations_label as org,
a.destinations_label as des,
date_format(a.depart_date,'%Y%m%d') as dep_date,
b.vehicle_no as train_no,
b.booking_no as book_code,
get_pax_num_adult(a.booking_no) pax_num,
get_pax_num_child(a.booking_no) pax_num_ch,
sf_get_pax_nm(b.pax_id) pax_name,
b.coach_code,
b.coach_seq,
b.seat_str_row,
b.seat_str_col,
(select sum(f.TOTAL)
from fares f, transactions tr
where tr.FARES_ID = f.FARES_ID
and tr.TRANS_HOLD_ID = a.TRANS_HOLD_ID) AS normal_sales,
0 extra_fee,
a.balance book_balance FROM transactions_hold a, transactions b WHERE b.trans_hold_id = a.trans_hold_id
AND a.TRANS_HOLD_ID = '$trans_hold_id'
";
echo($kueri);
$hquery = mysql_query($kueri) or die(mysql_error());
$num_rows = mysql_num_rows($hquery);
echo($num_rows); ?>
被ws_booking
插入到 MySQL 数据库中,并返回$trans_hold_id
以在第二个查询中使用。有$trans_hold_id
一个值,但是当我运行第二个查询时,为什么$num_rows
返回 0?
请注意,数据存在于数据库中。