El siguiente código, aparte de mostrar lo mal que programo :) , contiene algunos errores graves; en realidad, esta porción de código intenta reproducir un error observado en otra aplicación :-P .

php:
<?php
/* Timer start */
$mtime = explode(' ', microtime() );
$timestart = $mtime[1] + $mtime[0];

include_once dirname(__FILE__) . '/db.php';

header( 'Content-type: text/html; charset=utf-8' );

if ( empty($_GET['category']) || !is_numeric($_GET['category']) ) {
        header( 'Location: error.html' );
}

$posts = $db->get_results("     
        SELECT  posts.id, posts.name, posts.content,
                    users.name as author
        FROM    posts, users
        WHERE   posts.userid = users.userid AND
                        posts.category_id = {$_GET['category']}
        LIMIT   10"
);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xml:lang="es">

<head>
        <title>Search results</title>
</head>

<body>

        <div id="content">
        <?php if ( $posts ) : ?>

        <h2><?php echo count($posts); ?> elementos encontrados.</h2>   
       
        <?php foreach ( $posts as $post ) : ?>
               
        <div class="post">                 
                <h4 class="post-meta">
                <a href="ver.php?id=<?php echo $post->id; ?>"><?php echo $post->name; ?></a> |
                <?php echo $post->autor; ?>
                </h4>
                       
                <div class="content">
                <?php echo $post->content; ?>
                </div>
                       
        </div>
               
        <?php endforeach; ?>

        <?php else : ?>
       
        <p>No se encontró ningún post en la categoría seleccionada.</p>
       
        <?php endif; ?> 
        </div>
       
        <div id="footer">
       
        <?php
       
        /* Timer stop */       
        $mtime = explode(' ', microtime());
        $timeend = $mtime[1] + $mtime[0];
        $timetotal = $timeend - $timestart;
        $time = number_format($timetotal, $precision);
       
        echo <<<STATS
<!--
Referer: {$_SERVER['HTTP_REFERER']}
User IP: {$_SERVER['REMOTE_ADDR']}
-->

Página generada en {$time} segundos
STATS;
        ?>
        </div>
</body>

</html>