Hi
Error while using Search
Couldn't execute query. Column 'id' in where clause is ambiguous – SELECT count(*) as c FROM (SELECT t.id ,t.title, rr.s_no, rr.henkyakuyotei FROM tosho as t INNER JOIN (SELECT r.id,s_no,henkyakuyotei,r.status FROM rent as r WHERE r.status ='2') AS rr WHERE t.status = '2' AND ( `id` LIKE '%2%' )) pg_tmp
SQL is follow.This can run in phpMyAdmin .
SELECT t.id ,t.title, rr.s_no, rr.henkyakuyotei FROM tosho as t INNER JOIN (SELECT r.id,s_no,henkyakuyotei,r.status FROM rent as r WHERE r.status ='2') AS rr WHERE t.status = '2'
2 Answers
You need to add table name with this column as ID is used twice in query.
e.g.
$col = array();
$col["name"] = "id";
$col["dbname"] = "t.id";
…
Your Answer