Error while using Search

QuestionsError while using Search
hirohito wada asked 4 years ago

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
Abu Ghufran answered 4 years ago

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";

hirohito wada answered 4 years ago

Abu, I solved the problem.

Thanks!

Your Answer

17 + 3 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?