Ploufy - 2003-10-20

I can't display the result of this query
<? include "template.inc";

$db=mysql_connect("localhost","","");
mysql_select_db("mybd",$db);
$sql="SELECT * FROM mytable";
$req=mysql_query($sql) or die("SQL Error!<br>".$sql."<br>".mysql_error());

$tpl = new Template();
$tpl -> set_file("mylist","test_list.tpl");
$tpl -> set_block("mylist","LOGS_LIST","block_liste");

while ($data=mysql_fetch_array($req))
{
    $tpl -> set_var("LogID",$data["LogID"]);
    $tpl -> parse("block_list","LOGS_LIST",true);
}

mysql_close();
$tpl -> pparse("display","mylist");
?>

in php4 (without phplib) it takes 8s, with phplib it's too long (more than 30s)... the query returns 50000 records.

Is there something to optimize in my code?

Thanks by advance