no, did not work unfortunetly. here is the whole code i explained on the begining of the thread what i'd really like it to do. can we riwrite it so that it also does the calculation?
<?
echo "<body><table align=center cellpadding=1 cellspacing=0><tr><td colspan=6><br><span class=text>Total queries analyzed: $total</span></td></tr><tr><td bgcolor=\"#0000aa\" colspan=\"6\"></td></tr><tr><td align=center><span class=heading2>N</span></td><td background=/img/dots.gif></td><td align=center><span class=heading2>Phrase</span></td><td align=center><span class=heading2>Requests</span></td><td align=center><span class=heading2>Percent</span></td><td background=/img/dots.gif></td></tr><tr><td bgcolor=#0000aa colspan=6></td></tr>";
$server = "myserver";
$userid = "myid";
$pass = "mypass";
$database = "mydb";
$dbtable = "r_research";
$recordLimit= 50;
$prevStatus = "Show Previous $recordLimit Results";
$nextStatus = "Show Next $recordLimit Results";
$prevLink = "< Previous|";
$nextLink = "|Next >";
$fontfamily = "tahoma, helvetica";
$fontsize = "10px";
$fontcolor = "#000000";
$inactivecolor = "#666666"; // Color for when there is no link
$fontweight = "700";
$textdecoration = "none";
function pageStatus($i){
echo " Click to View Page $i";
}
$con = mysql_connect("$server","$userid","$pass");
$db = mysql_select_db("$database",$con);
if (!isset($thisOffset) || $thisOffset < 0) $thisOffset=0;
if ($action==search) $thisOffset = $thisOffset - 1;
if (!isset($lineIndex) || $lineIndex < 0) $lineIndex=0;
if ($action==search) $lineIndex = $lineIndex - 1;
$sql="SELECT DISTINCT * FROM $dbtable, r_date WHERE r_research.pid=r_date.pid ORDER BY request DESC";
$getTotalRows = mysql_query($sql, $con);
$totalRowsNum = mysql_num_rows($getTotalRows);
$sql.=" Limit $thisOffset,$recordLimit";
$query = mysql_query($sql, $con);
while ($result=mysql_fetch_array($query)) {
$lineIndex++;
$pid=$result['pid'];
$phrase=$result['phrase'];
echo "<tr><td><span class=text>$lineIndex.</span> </td><td background=/img/dots.gif></td><td><span class=text>$phrase</span></td><td align=center width=100><span class=text>$request $sum</span></td><td align=center><span class=text>$percent(dont worry about this now)</span></td><td background=/img/dots.gif></td></tr><tr bgcolor=#eeeeee><td background=/img/dots.gif colspan=6></td></tr>";
}
echo "</table><br><br><center>";
if ($totalRowsNum <= $recordLimit) {
// less than recordLimit returned.
} else {
if ($thisOffset!=0) { $prevOffset = intval($thisOffset-$recordLimit);
echo "<a style='font-family:$fontfamily; font-size:$fontsize; color:$fontcolor; font-weight:$fontweight;"
." text-decoration:$textdecoration;' onmouseover=\"window.status='$prevStatus'; return true\""
." onmouseout=\"window.status=''\" href=\"all.php?thisOffset=$prevOffset&lineIndex=$prevOffset\">"
."$prevLink</a> ";
}
else { echo "<span style='font-family:$fontfamily; font-size:$fontsize; color:$inactivecolor;"
." font-weight:$fontweight; text-decoration:$textdecoration;'>$prevLink</span> ";
}
$totalPages = intval($totalRowsNum/$recordLimit);
if ($totalRowsNum%$recordLimit) $totalPages++;
for ($i=1;$i<=$totalPages;$i++) {
if ((intval($thisOffset/$recordLimit)) == (intval($i-1))) {
echo " <span style='font-family:$fontfamily; font-size:$fontsize; color:$inactivecolor;"
." font-weight:$fontweight; text-decoration:$textdecoration;'>$i</span> ";
} else {
$nextOffset= intval($recordLimit*($i-1));
echo " <a style='font-family:$fontfamily; font-size:$fontsize; color:$fontcolor;"
." font-weight:$fontweight; text-decoration:$textdecoration;' onmouseover=\"window.status='";
pageStatus($i);
echo "'; return true\" onmouseout=\"window.status=''\""
." href=\"all.php?thisOffset=$nextOffset&lineIndex=$nextOffset\">$i</a> ";
}
}
if (!(intval(((intval($thisOffset/$recordLimit))+1))==$totalPages) && $totalPages!=1) {
$nextOffset = intval($thisOffset+$recordLimit);
echo " <a style='font-family:$fontfamily; font-size:$fontsize; color:$fontcolor; font-weight:$fontweight;"
." text-decoration:$textdecoration;' onmouseover=\"window.status='$nextStatus'; return true\""
." onmouseout=\"window.status=''\" href=\"all.php?thisOffset=$nextOffset&lineIndex=$nextOffset\">$nextLink</a><p>\n";
}
else echo " "
."<span style='font-family:$fontfamily; font-size:$fontsize; color:$inactivecolor;"
." font-weight:$fontweight; text-decoration:$textdecoration;'>$nextLink</span><p>";
}
mysql_close($con);
//End
?>