Hello!
I have this code:
<?php
$columns = 3;
mysql_connect('localhost','','');
mysql_select_db('');
//change the query to get another field from the database
$query = "SELECT * FROM terms ORDER BY termID";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$rows = ceil($num_rows / $columns);
while($row = mysql_fetch_array($result)) {
$data[] = $row['termID'];
//store the other field into an array
$data2[] = $row['keyword'];
}
echo "<TABLE BORDER=\"0\">\n";
for($i = 0; $i < $rows; $i++) {
echo "<TR>\n";
for($j = 0; $j < $columns; $j++) {
if(isset($data[$i + ($j * $rows)])) {
echo "<TD>" . $data[$i + ($j * $rows)] . "</TD>\n";
//echo out the field
echo "<TD>" . $data2[$i + ($j * $rows)] . " </TD>\n";
}
}
echo "</TR>\n";
}
echo "</TABLE>\n";
?>
This code it display me the terms from my sql... 3 columns...
But the problem is that it display me all data into a page!
And i have 200.000 records!
I want to view only 50 records/page (in column style) ..and to generate link..prev.. (1 2 3 ..... next)!
So..who could help me?
Thanks in advance!