rendered paste bodypublic function pagination( $table, $limit, $page, $show )
{
if ( isset( $show ) )
{
if ( is_numeric( $show ) )
$query = "SELECT * FROM `" . $table . "` ORDER BY `ID` LIMIT " . $show . "";
else
$query = "SELECT * FROM `" . $table . "` ORDER BY `ID`";
$result = mysql_query( $query );
$fieldnameQuery = "SHOW COLUMNS FROM `" . $table . "`";
$fieldnameResult = mysql_query( $fieldnameQuery );
if ( mysql_num_rows( $fieldnameResult ) > 0 )
{
while ( $fields = mysql_fetch_array( $fieldnameResult ) )
{
$array_return[$fields['Field']] = array();
while ( $row = mysql_fetch_assoc( $result ) )
{
array_push( $array_return[$fields['Field']], $row[$fields['Field']] );
}
}
}
}
return array( $array_return );
}