5 function array_to_combo($a) {
6 foreach($a as $k => $v){
7 echo "<option value=\"{$v}\">{$v}</option>";
11 function query($q,$f) {
12 $db = mysql_pconnect("localhost","helm");
13 mysql_select_db("matita");
14 $rc = mysql_query($q,$db);
16 die("Query failed: " . mysql_error());
18 while( $row = mysql_fetch_array($rc, MYSQL_ASSOC)){
21 mysql_free_result($rc);
25 function time_2_cents($t) {
27 $rex = "/^(\d+)m(\d\d?)\.(\d{2})s$/";
28 $m = preg_match($rex,$t,$matches);
29 if ( $m == 0 ) exit(1);
30 $t_minutes = $matches[1];
31 $t_secs = $matches[2];
32 $t_cents = $matches[3];
33 return ((int) $t_cents) + ((int) $t_secs) * 100 + ((int)$t_minutes) * 6000 ;