<% include "dbaccess.php"; // Create list of all photos on the site, sorted by musician (alphabetically) and date photo was taken $strSQL = "SELECT * FROM PICTURES ORDER BY LNAME ASC, FNAME ASC, PICDATE ASC"; $photoIndexResults = mysql_query($strSQL) or die (mysql_error()); %> Guy Fonck Jazz Photography - Photo Index
Return to home page A page about me Links to other websites

Index of all photos on Focus On Jazz

The index is sorted alpabetically by musician (last name first) and
chronologically by date when the photo was taken.
Click on the name of the musician to access the pictures.
<% // counter of rows being displayed $photoIndexRowCounter = 0; // keep track of which column we are currently working on (two-column layout) $photoIndexColumn = 1; // keep track of the musician whose pic are currently shown $currentMusician = ""; // put 1/2 of the entries into a first cell of the table (creates two-column layout) $nbrIndexEntries = mysql_num_rows($photoIndexResults); while ($photoIndexRow = mysql_fetch_array($photoIndexResults)){ $photoIndexRowCounter ++; if ($currentMusician != $photoIndexRow['FNAME']." ".$photoIndexRow['LNAME']){ // first row in the query results for a new musician // remember the new musicion $currentMusician = $photoIndexRow['FNAME']." ".$photoIndexRow['LNAME']; // test if we should start the second column for the overall layout, // as we have shown at least 1/2 of the entries if (($photoIndexColumn == 1) && ($photoIndexRowCounter > ($nbrIndexEntries/2))){ echo ""; // start second column $photoIndexColumn = 2; // remember that we started 2nd column } // print out musician name echo ""; echo "
".$photoIndexRow['FNAME']." ".$photoIndexRow['LNAME']."
"; echo "
"; } echo "
"; echo "
  • "; if ($photoIndexRow['PICDATE'] != "1900-12-31"){ echo "".date("M j Y",strtotime($photoIndexRow['PICDATE'])).""; echo " — "; } echo "".$photoIndexRow['PICTITLE'].""; echo "
  • "; }%>