function query($q,$f) {
$db = mysql_pconnect("localhost","helm");
mysql_select_db("matita");
- $q = preg_replace("/\n/"," ",$q);
+ $q = ltrim(rtrim(preg_replace("/\n/"," ",$q)));
if (!preg_match("/^(select|describe)[^\n;]*;?$/i",$q)) {
die("Query not allowed!<pre>" . $q . "</pre>");
return;