$sql

\n"; pg_exec( $conn, $sql ); } $sql = "select " . "to_char( ipl_date_ins, $datefmt ) as ipl_date_ins, " . "ipl_seq_nr, " . "ipl_directory, " . "ipl_name " . "from " . "ices2_playlist " . "where " . "ipl_date_start is null and " . "ipl_date_end is null " . "order by " . "ipl_date_ins, " . "ipl_seq_nr"; $rs = pg_exec( $conn, $sql ); if( $row = pg_fetch_array($rs) ) { $found = 1; $date = $row["ipl_date_ins"]; $seqnr = $row["ipl_seq_nr"]; $dir = $row["ipl_directory"]; $name = $row["ipl_name"]; if( $dir == "/" ) { $dir = ""; } else { $dir .= "/"; } } if( $localconn != 0 && $found != 0 ) { $sql = "update " . "ices2_playlist " . "set " . "ipl_date_start = current_timestamp " . "where " . "to_char( ipl_date_ins, $datefmt ) = '$date' and " . "ipl_seq_nr = $seqnr"; // echo "

$sql

\n"; pg_exec( $conn, $sql ); } } if( $localconn != 0 ) { if( $found != 0 ) { echo "$music_dir/$dir$name\n"; } } else { echo "\n"; echo "\n"; echo "ices2\n"; echo "\n"; echo "\n"; echo "

ices2 next

\n"; echo "

\n"; if( $found != 0 ) { echo "$date ($seqnr): $dir$name\n"; } else { echo "not found :(\n"; } echo "

\n"; echo "\n"; echo "\n"; } ?>