This of course is going to be an infinite loop, provided at least one element matches the query; I suspect that in your infinite loop, you never progress past the first element returned by the query.
while ($tagrow = mysql_fetch_assoc(mysql_query("SELECT * FROM posts WHERE tag='$usersearch' ORDER BY id DESC"))) {
The function mysql_fetch_assoc
is going to take in a result set of a query, and iterate through it, returning the next element in the series each time it is called.
The function mysql_query
is going to take a query and return a result set;
They way you have your while loop structured, you will be executing the query, and passing the result set directly into the fetch_assoc, which will inturn assign the value of $tagrow to the first element; and then do it again, and again.
What we need to do instead, is execute the query, and then save the result set. This makes it so you only need to execute the query once, instead of on each iteration, and save the results in memory.
We can do this by simply breaking it into the following two lines, and using a variable as temporary storage of the query results.
$results = mysql_query( "SELECT * FROM posts WHERE tag='$usersearch' ORDER BY id DESC" );
while ( $tagrow = mysql_fetch_assoc( $results ) ) {