Correctly, you incorrectly estimate results.
mysql_fetch_assoc()returns only one row at a time. Use a loop to read all the lines.
$query = mysql_query("SELECT `title`, `url_title` FROM `fastsearch` WHERE `tags` LIKE '%$q%' LIMIT 5");
$resultSet = array();
while ($cRecord = mysql_fetch_assoc($query)) {
$resultSet[] = $cRecord;
}
source
share