global $gCms; $db = &$gCms->db; //add table headers $output .= ' '; //the query $q = "SELECT * FROM episodes ORDER BY Date DESC"; $dbresult = $db->Execute( $q ); //we didnt get any results lets spit out a error if( !$dbresult ) { echo 'DB error: '. $db->ErrorMsg()."
"; } //get one row at a time and add it to output while ($dbresult && $onerow = $dbresult->FetchRow()) { //these will be printed before form $output .= ''; $output .= '"; $output .= '"; $output .= '"; $output .= ''; $output .= ""; } $output .= "
Air Date Title # Screencaps
'. date('m/d/y',strtotime($onerow['Date'])) ."'. $onerow['Title'] ."'. $onerow['Episode_Number'] ."'.(isset($onerow['Screencaps']) && $onerow['Screencaps'] != ''?'Screencaps':' ').'
"; echo $output;