I have a seemly silly question but serious headache to ask you. I'm not quite a new sql but not too new. I coded many sqls but never found a problem like this before. The query can result in phpmysql but I can't get any row from PHP. Here's my code :
SELECT reb_dis, reb_title, reb_detail
FROM rate_eb WHERE reb_abook <= '77'
AND ABS(DATEDIFF('2013-09-09','2013-09-05'))>=reb_mn
AND '2013-09-05' BETWEEN reb_date1 AND reb_date2
AND '2013-09-09' BETWEEN reb_date1
AND reb_date2
So this is how I wrote my PHP:
$sql_eb="SELECT reb_dis, reb_title, reb_detail
FROM rate_eb WHERE reb_abook <= '77'
AND ABS(DATEDIFF('2013-09-09','2013-09-05'))>=reb_mn
AND '2013-09-05' BETWEEN reb_date1 AND reb_date2
AND '2013-09-09' BETWEEN reb_date1 AND reb_date2";
$result_eb=mysql_query($sql_eb);
$rec_eb=mysql_fetch_array($result_eb);
But I can't get any of the value from DB. No matter I tried:
<?
echo $rec_eb[reb_dis];
echo $rec_eb[reb_title];
echo $rec_eb[reb_detail];
?>
None of the above data shows. While I can get the data from other simpler query. So may I beg you guys explanations why this lines of query doesn't show anything??? And also how to get its data.
Regards,