lundi 29 février 2016

Need to build complex sqlite query

Have two sqlite tables:

sh_item
id
title
..

and

sh_paramvalues
id
paramid
itemid
value

Have some query that i need to modify

//$get[0] - search query from user
$this->q        = "SELECT * FROM sh_item WHERE title LIKE '%".$get[0]."%' OR descr LIKE '%".$get[0]."%' LIMIT '".$this->page->start."','".$this->page->on1page."'";

I need some query that could get value ( LIKE '%".$get[0]."%') from sh_paramvalues where paramid='some my value' and itemid = id wich use sh_item in base query.

Maybe i need to use join but i am not good at that..

Aucun commentaire:

Enregistrer un commentaire