I am getting zero in $booked_num
, I tried the query in SQL with values in place of variables, it worked fine. But I don't know where I am making a mistake, please help.
I already echoed every variable and everything is fine, but nothing is there in $booked_row
and $booked_num
is echoing zero.
require_once 'mysql_connector.php';
$booked_result = mysql_query('select * from booked where train_no = ".$train_no." and date = ".$date." and st_from = ".$st_from." and st_to = ".$st_to.";') or die(mysql_error()) ;
$booked_num = mysql_num_rows($booked_result);
echo $booked_num;
$booked_row = mysql_fetch_array($booked_result,MYSQL_ASSOC);
print_r($booked_row);