Forum Moderators: open
I'm having problems there. It returns the data when I remove every condition except the first two. I have tested many variations removing different conditions and checking wether it worked. Yet I haven't found a solution. It doesn't give an error message. It just doesn't "find" the result.
Would be helpful if someone could correct my mistages :)
echo "SELECT * FROM advertising WHERE img_type='".$ad_type."' AND limit_time>'".time()."' AND limit_views<views AND (country_target LIKE '%".$countrycode."%' OR country_target='all') AND country_denied NOT LIKE '%".$countrycode."%' ORDER BY rand() LIMIT 1";
all I have done there is to cut and paste your mysql statement into an echo.
Run your script and see what appears.