patimages
07-25-2007, 05:14 AM
Hi,
I have a mysql table with about 400,000 rows and sevral coulums. If I search using php for "a", the expected number of matches is above 260,000 and I get a "Warning: mysql_query() [function.mysql-query]: Unable to save result set". I guess it is too much. However, I just would like to count the matches, not display them... Is there a way to count my matches anyway ?
thanks for any help !
I use :
$data = mysql_query("SELECT * FROM tab WHERE upper($field) LIKE'%$query%'");
$anymatches=mysql_num_rows($data);
I have a mysql table with about 400,000 rows and sevral coulums. If I search using php for "a", the expected number of matches is above 260,000 and I get a "Warning: mysql_query() [function.mysql-query]: Unable to save result set". I guess it is too much. However, I just would like to count the matches, not display them... Is there a way to count my matches anyway ?
thanks for any help !
I use :
$data = mysql_query("SELECT * FROM tab WHERE upper($field) LIKE'%$query%'");
$anymatches=mysql_num_rows($data);