RE: [PHP-DB] Query syntax error?
Thanks, I got it working now, had to use the a/b/c thing a few times -Original Message- From: jose [mailto:jojap...@gmail.com] Sent: Thursday, January 13, 2011 9:52 AM Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Query syntax error? you have renamed places_data table to 'a' 2011/1/13 Harvey : > Hello, > > I have a query on a page that used to work fine, but is now generating an > error. > > I assume that the version of php or mysql was updated on the webhost server > or something like that? > > Here is the query: > > select count(places_data.place_id) as areacount, boroughs.borough_name as > boroname, area.area_name as areaname, area.area_id as areaid > from places_data a > inner join boroughs b on a.area_fid = b.area_id > inner join area c on c.borough_fid = b.borough_id > where places_data.on_off_fid = 2 > " . $cat_query . " > group by c.area_name > order by b.borough_name ASC, c.area_name ASC > > And here is the error message: > > Unknown column 'places_data.place_id' in 'field list' > > But place_id is a field in places_data table. > > Any ideas? > > Thanks! > > Harvey > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Query syntax error?
you have renamed places_data table to 'a' 2011/1/13 Harvey : > Hello, > > I have a query on a page that used to work fine, but is now generating an > error. > > I assume that the version of php or mysql was updated on the webhost server > or something like that? > > Here is the query: > > select count(places_data.place_id) as areacount, boroughs.borough_name as > boroname, area.area_name as areaname, area.area_id as areaid > from places_data a > inner join boroughs b on a.area_fid = b.area_id > inner join area c on c.borough_fid = b.borough_id > where places_data.on_off_fid = 2 > " . $cat_query . " > group by c.area_name > order by b.borough_name ASC, c.area_name ASC > > And here is the error message: > > Unknown column 'places_data.place_id' in 'field list' > > But place_id is a field in places_data table. > > Any ideas? > > Thanks! > > Harvey > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Query syntax error?
Hello, I have a query on a page that used to work fine, but is now generating an error. I assume that the version of php or mysql was updated on the webhost server or something like that? Here is the query: select count(places_data.place_id) as areacount, boroughs.borough_name as boroname, area.area_name as areaname, area.area_id as areaid from places_data a inner join boroughs b on a.area_fid = b.area_id inner join area c on c.borough_fid = b.borough_id where places_data.on_off_fid = 2 " . $cat_query . " group by c.area_name order by b.borough_name ASC, c.area_name ASC And here is the error message: Unknown column 'places_data.place_id' in 'field list' But place_id is a field in places_data table. Any ideas? Thanks! Harvey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php