//A mySQL Table Displaying and Paging Snippet Version 1.1 //by Elliott Edwards (eedwards@hachisoft.com) //Standard Disclaimer: //This code snippet is provided AS IS. Neither Elliott Edwards nor Hachisoft are //to be held responsible for any failures or security flaws in this code. Use at your //own risk. //Distribution: If you want to use this code commercially or share it with friends, //Go Ahead. Just kindly give credit where it is due: (Elliott Edwards & Hachisoft). Thanks //If you appreciate this snippet or have comments, email eedwards@hachisoft.com //Updates and improvements are already in the works. see www.hachisoft.com for more details. //TO INSTALL: Put this script in an appropriate file, and then // refer to it in a manner somewhat like the following code: //include our snippet require ('gamesdbviewcubs.php'); //Or whatever you name the snippet //Override some defaults $tblQuery['columns']='*'; //The columns to select $tblQuery['tblName']='Newgames'; //The table to select from $tblQuery['where']="WHERE C Like 'C' AND Type = 'Indiv'"; //The Where clause for the SELECT $tblQuery['viewSize']='500'; //How many records to a page //Pass along any self-referral parameters for table ordering and paging ////////////////////////////////////////////////////////////////////// if (isset($orderBy)) $tblQuery['orderBy']=$orderBy; //The column to orderBy if (isset($viewStart)) $tblQuery['viewStart']=$viewStart; //The starting offset for record paging if (isset($orderDir)) $tblQuery['orderDir']=$orderDir; //Whether to sort ascending or descending ('ASC' or 'DESC') //To Set a default self-referral parameter: ///////////////////////////////////////////////// //if (isset($orderDir)) // $tblQuery['orderDir']=$orderDir; //else // $tblQuery['orderDir']='DESC'; //To set column-specific formatting and processing: /////////////////////////////////////////////////// $tblFormat['colFormat']=array( 'Column1'=>array( //The name of the column is case-sensitive 'formatBegin'=>'', //prefix formatting inside column 'formatEnd'=>'', //sufffix formatting inside column 'colBegin'=>'