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