php - INNER JOIN mysql boolean error -


$results2=mysql_query(" select * searchengine    id in (" . implode(',', $ids) . ")    or id in (" . implode(',', $ids2) . ") inner join keywords on searchengine.id=keywords.id order    (relevant-irrelevant) desc,    (rating/votes) desc,    report asc,    length(description) desc,    title asc limit $page, $limit "); 

something in code above doesn't function thought will,the while loop returns boolean error.

the code implode functions working fine.

my databases searchengine , keywords

searchengine : id ,title,desc...

keywords : num,id,a,b

the , b id should added searchengine(based on same id) make (id,title,desc,a,b...).ask need more details.

note:searchengine id unique number,but keywords can have same id multiple times(one of same ids picked , b values , inserted $ids1).

  • move clauses below joins.
  • qualify id table name. searchengine.id

select * searchengine inner join keywords on searchengine.id=keywords.id    searchengine.id in (" . implode(',', $ids) . ")    or searchengine.id in (" . implode(',', $ids2) . ") order    (relevant-irrelevant) desc,    (rating/votes) desc,    report asc,    length(description) desc,    title asc limit $page, $limit 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -