help with php search

ThEgAnJaFiEnD

New Member
How would I do let the user know if there wasnt any rows found?And if it finds (for example) 26 rows I want it to print that it found 26 hits (Your search for "hey" gave 26 results)\[code\]$name = mysql_real_escape_string($_POST['player_name']);$q = mysql_query("SELECT * FROM players WHERE name LIKE '%$name%'");while ($row = mysql_fetch_array($q)) { $name = $row['name']; echo "<ul>\n"; echo "<li>" . "<a href=http://stackoverflow.com/questions/1998921//"player-info.php?id=\">" .$name . " </a></li>\n"; echo "</ul>"; }\[/code\]
 
Back
Top