Hi everybody !
I have a problem with a module i'm trying to develop. I can't find what's wrong with my code, so your help would be very appreciate !
I pass a variable in my url to filter on my news categories. Here is my URL with my variable 'cat' :
index.php?option=com_content&task=section&id=1&Itemid=2&cat=13
Now, here is my PHP code to extract my variable content :
$url = $_SERVER['QUERY_STRING'];
parse_str($url, $output);
$cat = $output['cat'];
And now my SQL code :
$query = "SELECT count(id) FROM #__content WHERE sectionid = '1' AND catid = $cat AND state = '1'";
When i execute my module, i have no result. If i set the debug mode on, i can see my variable is passed :
SELECT count(id) FROM jos_content WHERE sectionid = '1' AND catid = 13 AND state = '1'
But, if i manually set "$cat = 13" in my php code, i have my module result !
I don't know why it's not working... Someone could help me, please ?