php - Can't make query work with variable -


i have query

and i.state = 1 , i.language = "'.$mylang.'" , i.access in ('.implode(',', $user->getauthorisedviewlevels()).') 

i should content current language) strange thing php variable $mylang it's not working ( writing it-it ) content. allready checked result of $mylang , = it-it .

any clues? thanks.

i'm not sure 1=1 subclause in ignoring try this:

$db = jfactory::getdbo(); $query = $db->query(true); $query->select('i.*')     ->from($db->qutename('#__content'))      ->where($db->quotename('i.state') . ' = 1')     ->where($db->quotename('i.language') .' = '  $db->quote($mylanguage))     ->where($db->quotename('i.access') . ' in (' . impode(',',$user->getauthorisedviewlevels()) . ')' )  ... ; $db->set($query); .... 

also, if queries not working best thing echo $query->dump() see rendered query, can @ queries if turn debugger on.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -