return $s;
}
-?>
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css"/>
- </head>
- <body>
- <h1>QUERY results</h1>
-<? foreach( $qs as $name => $q) { ?>
- <h2><? echo $name; ?></h2>
- <p>
- <tt><? print $q; ?></tt>
- </p>
- <table border=1>
- <?
- $q = query($q);
+function printer($q){
+ static $i = 0;
+ if ( $i == 0) {
echo "<tr>";
- foreach( $q[0] as $name => $txt) {
+ foreach( $q as $name => $txt) {
echo "<th>$name</th>";
}
echo "</tr>\n";
+ } else {
$i=0;
foreach ($q as $k => $v) {
$i = $i + 1;
}
echo "</tr>\n";
}
- ?>
+ }
+ $i++;
+}
+
+?>
+<html>
+ <head>
+ <link type="text/css" rel="stylesheet" href="style.css"/>
+ </head>
+ <body>
+ <h1>QUERY results</h1>
+<? foreach( $qs as $name => $q) { ?>
+ <h2><? echo $name; ?></h2>
+ <p>
+ <tt><? print $q; ?></tt>
+ </p>
+ <table border=1>
+ <? query($q,&$printer); ?>
</table>
<? } ?>
<p><a href="bench.php">BACK to the query page</a></p>