Hi,
I use the following function to display any query i send to it. Some of
these queries produce 1000's of rows and produce an internal server error,
is there a way to paginate any query sent to it - say 1000 rows per page?
Thanks for your help
// query functions
function doQuery($query){
if(!($result = mysql_query(stripslashes($query)))){
echo '<br><br><div align="center">'.mysql_error().'</div>';
exit;
} else {
$num_fields = mysql_num_fields($result);
$num_rows = mysql_num_rows($result);
if ($num_fields > 0 && $num_rows > 0){
echo '
<table border="1" cellspacing="0" cellpadding="2"
bordercolor="#FFFFFF">
<tr>';
for($i = 0; $i < mysql_num_fields($result); $i++){
echo '<td bgcolor="#ffffff"
align="center"><strong>'.mysql_field_name($result, $i).'</strong></td>';
}
for($i = 0; $i < mysql_num_rows($result); $i++){
echo '<tr>';
$row_array = mysql_fetch_row($result);
for($j = 0; $j < mysql_num_fields($result); $j++){
echo '<td bgcolor="#eeeeee" align="center">'.$row_array[$j].'</td>';
}
echo '</tr>';
}
echo '</table>';
} else {
echo '<br><br><div align="center">No data in table</div>';
}
}
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php