\n\n");
##   }
##   else {
##     printf("Could not open database
\n"); ## } $mysqli = new mysqli('localhost', 'gcomp', 'd7Hr42#X', 'garagecomps'); if ($mysqli->connect_errno) { printf("Could not open database
\n"); } $query = "SELECT title, volume, subtitle FROM titles WHERE code = $code"; # print("$query
\n"); ## $result = mysql_query($query, $db) or die ("Invalid query"); $result = $mysqli->query($query) or die ("Invalid query"); $record = $result->fetch_assoc(); printf("%s ", $record['title']); $volume = $record['volume']; if ($volume) { print("#$volume "); } if ($record['subtitle']) { printf("[%s] ",$record['subtitle']); } printf("- %s\n", $dformat); $query = "SELECT comps.${format}_code, bands.article as Article, bands.band_name as Artist, "; $query .= "songs.song as Title, songs.song_id as Song_ID, bands.band_id as Band_ID, "; $query .= "${format}trackorder.side as Side, ${format}trackorder.track as Track "; $query .= "FROM comps LEFT JOIN bands ON comps.band_id = bands.band_id "; $query .= "LEFT JOIN songs ON comps.song_id = songs.song_id "; $query .= "LEFT JOIN ${format}trackorder ON comps.comps_id = ${format}trackorder.comps_id "; $query .= "WHERE comps.${format}_code = $code "; $query .= "ORDER BY side, track"; ## print $query; ## $result = mysql_query($query, $db) or die ("Invalid query"); ## $top = mysql_num_rows($result); $result = $mysqli->query($query) or die ("Invalid query"); $top = $result->num_rows; $side = " "; if ($format == "cd") { $syde = "CD"; } else { $syde = "Side"; } $i = 0; while ($i < $top) { $record = $result->fetch_assoc(); if (($side != $record['Side']) && ($record['Side'] != 0)) { printf("\n%s %s\n", $syde, $record['Side']); $side = $record['Side']; } if ($record['Track'] < 10) { print(" "); } if ($record['Track'] != 0) { printf(" %s", $record['Track']); } else { print(" *"); } if ($record['article']) { printf(" %s %s - %s\n", $record['Article'], $record['Artist'], $record['Title']); } else { printf(" %s - %s\n", $record['Artist'], $record['Title']); } $i++; } ?>