Welcome Guest, Not a member yet? Register   Sign In
Active Query bug?
#1

(This post was last modified: 11-12-2018, 02:46 PM by fabby.)

PHP Code:
Error Number1052

Column 
'id' in field list is ambiguous

SELECT 
`id`, `s_cities`.`id` as `source_city_id`, `d_cities`.`id` as `destination_city_id`, `jobs_raw`.* FROM `jobs_rawLEFT JOIN `cities` as `s_citiesON `s_cities`.`realName`=`jobs_raw`.`source_cityLEFT JOIN `cities` as `d_citiesON `d_cities`.`realName`=`jobs_raw`.`destination_cityWHERE `jobs_raw`.`id` = '38567' 

PHP Code:
$this->db->select('s_cities.id as source_city_id, d_cities.id as destination_city_id, jobs_raw.*');
$this->db->join('cities as s_cities''s_cities.realName=jobs_raw.source_city''left');
$this->db->join('cities as d_cities''d_cities.realName=jobs_raw.destination_city''left');
$this->db->where('jobs_raw.id'$id);
$this->db->get('jobs_raw')->row(); 

Notice the Select `id`in the first code block. Its an error that should not happen since that selection is not made in the code. Yet this error shows up. But the funny thing is here that doing this on a different codeigniter install of mine makes it work flawless. Same database, same versions. Latest 3.X
Reply


Messages In This Thread
Active Query bug? - by fabby - 11-12-2018, 01:12 PM
RE: Active Query bug? - by Pertti - 11-13-2018, 01:51 AM
RE: Active Query bug? - by php_rocs - 11-13-2018, 11:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB