3 function query($q,$f) {
4 $db = mysql_pconnect("localhost","helm");
5 mysql_select_db("matita");
6 $rc = mysql_query($q,$db);
8 die("Query failed: " . mysql_error());
10 while( $row = mysql_fetch_array($rc, MYSQL_ASSOC)){
13 mysql_free_result($rc);
17 function time_2_cents($t) {
19 $rex = "/^(\d+)m(\d\d?)\.(\d{2})s$/";
20 $m = preg_match($rex,$t,$matches);
21 if ( $m == 0 ) exit(1);
22 $t_minutes = $matches[1];
23 $t_secs = $matches[2];
24 $t_cents = $matches[3];
25 return ((int) $t_cents) + ((int) $t_secs) * 100 + ((int)$t_minutes) * 6000 ;
28 function array_to_combo($l,$a) {
29 echo "<select name=\"$l\">";
30 echo "<option value=\"--\">--</option>";
31 foreach ($a as $k => $v) {
32 foreach( array_keys($v) as $k1 => $i) {
33 echo "<option value=\"{$v[$i]}\">{$v[$i]}</option>";