mith36
08-07-2008, 11:03 AM
Hi,
I'm used to using mysql, but a db I'm working with atm is postgre...
I don't understand why this query works in php on one page and in a sql browser:
$q = "SELECT bwmon as bwmon, ewmon as ewmon, cdate AS cdate, e50 as e50, e10 as e10, e90 as e90 FROM fcst WHERE id='$id' AND source='COORD' ORDER BY cdate DESC LIMIT 1";
but in another page it only works this way
$q = "SELECT bwmon as bwmon, ewmon as ewmon, cdate AS cdate, e50 as e50, e10 as e10, e90 as e90 FROM fcst ORDER BY cdate DESC LIMIT 1";
The difference being the second doesnt have
WHERE id='$id' AND source='COORD'
What is going on? :(
I'm used to using mysql, but a db I'm working with atm is postgre...
I don't understand why this query works in php on one page and in a sql browser:
$q = "SELECT bwmon as bwmon, ewmon as ewmon, cdate AS cdate, e50 as e50, e10 as e10, e90 as e90 FROM fcst WHERE id='$id' AND source='COORD' ORDER BY cdate DESC LIMIT 1";
but in another page it only works this way
$q = "SELECT bwmon as bwmon, ewmon as ewmon, cdate AS cdate, e50 as e50, e10 as e10, e90 as e90 FROM fcst ORDER BY cdate DESC LIMIT 1";
The difference being the second doesnt have
WHERE id='$id' AND source='COORD'
What is going on? :(