小编Cas*_*sen的帖子

where子句中的列'id'是不明确的

我收到此错误,我无法弄清楚为什么?

错误号:1052
where子句中的列'id'不明确

SELECT `leads`.*,
       `customers`.`id` AS customers_id,
       `customers`.`name` AS customers_name,
       `customers`.`company` AS customers_company,
       `customers`.`email` AS customers_email,
       `customers`.`phone` AS customers_phone,
       `customers`.`created_at` AS customers_created_at,
       `customers`.`updated_at` AS customers_updated_at,
       `customers`.`ip_address` AS customers_ip_addressFROM (`leads`)
JOIN `customers` ON `customers`.`id` = `leads`.`customer_id`
WHERE `id` = '3'
  AND `leads`.`id` = '1'LIMIT 1
Run Code Online (Sandbox Code Playgroud)

文件名:/home/www/REMOVED/models/lead.php

行号:12

该函数如下所示:

function get($id)
{
  $this->db->select('leads.*, customers.id AS customers_id, customers.name AS customers_name, customers.company AS customers_company, customers.email AS customers_email, customers.phone AS customers_phone, customers.created_at AS customers_created_at, customers.updated_at AS customers_updated_at, customers.ip_address AS customers_ip_address');
  $this->db->where('leads.id', '1');
  $this->db->from('leads');
  $this->db->join('customers', …
Run Code Online (Sandbox Code Playgroud)

mysql codeigniter

8
推荐指数
1
解决办法
4万
查看次数

0
推荐指数
1
解决办法
2811
查看次数