I have this mysql query that I am using (see attachment):
$query="(SELECT * FROM ".$table." WHERE (locskew = '".$skew."') AND (locexact = 1) ORDER BY lr1 DESC LIMIT 5)";
The query works fine when locexact = 1, but if locexact != 1 then I get the following error:
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 11
I know this error occurs because there are no results when locexact = 1.
I need my code modified so that if there are no results returned or $cnt < 5 , the query is run again this time with locexact = 0.
If there are still no results, then echo "No Results." If there are results, echo the results with locexact = 1 on top and locexact = 0 on bottom. I want the combined results limit still at 5.
See attachment for full file. Also with this project, I don't want to give ftp access. This code should not be that hard to fix/modify for an experienced php/mysql programmer.