You are trying to divide an array.
You first have to get the number of rows in your result in order to calculate the jump value. Then you have to put all of the results into an array. Since you are already using <b>mysql_fetch_array()</b> to put the <b>columns</b> into an array, your data array will end up being a 2-dimensional array of rows and columns.
=======================
$result = mysql_query("select * from ".$prefix."_encyclopedia WHERE term LIKE '$get%' AND vid=$vid ORDER BY term ASC");
// calculate jumb value
$tempval = $mysql_numrows($result) / 3;
$jumpval = (int) $tempval;
// put data into array
$y = 0;
while($termlist = mysql_fetch_array($result)) {
$data[$y]= $termlist;
$y++
}
echo "<br>Results for the letter $get<br><br>";
// build table
echo "<table width=\"200\" align=\"center\">";
$idx = 0;
while ($idx <= $jumpval) {
print "<TR>";
$offset=$idx;
for ($i = 1; $i <= 3; $i++) {
print "<TD>";
if ($offset > $jumbval) {
print "&nbsp;";
}
else {
print "<a href=\"modules.php?op=modload&name=$ModName&file=index&action=DisplayTerm&vid=$vid&id=". $data[$offset]['id']."\">".$data[$offset]['term']."</a>";
}
print "</TD>";
}
$offset = $offset + $jumpval;
$idx++;
} // end while loop
echo "</table><br>";
=======================
I don't know where you are getting <b>$ModName</b> or <b>$vid</b> are. If they are also coming out of the result row, then you will also have to change those to:
<b>$data[$offset]['ModName']</b>
and
<b>$data[$offset]['vid']</b>
respectively.
HTH
-- Rich