Probeer de functie Thisfound_rows http://dev.mysql.com /doc/refman/5.0/en/information-functions.html#function_found-rows