thank you for taking the time to read my question.
it is simple but i keep getting stuck
i am attempting to generate a index for a dynamically produced pdf using dompdf.
i did a "SELECT catagory, SUM(entries) FROM table"
now i am passing it out as a while loop
while($row = mysql_fetch_array($SUMresult)){
$page = $row['SUM(hits)'];
echo " ". $row['catagory']. " contains ". $page . " listings";
echo "<br />";
}
which shows me how many entries exist for each catagory.
now when trying to generate the index. i need to
take the result of the above $page and increment each output with the prior output. dividing each by 15 for example
$page = $row['SUM(hits)'] / 15;
so the first result may be 0.6 then if the second result is 1.6 it should instead give me 2.2.
this way i can generate the index by knowing when each result set will end and how many will be on each page (each page containing 15 results)
i apologise if this seems a bit dumb an inexperienced but i highly value any insight into this
This post has been edited by JackOfAllTrades: 26 October 2010 - 04:28 AM
Reason for edit:: Added code tags

New Topic/Question
Reply




MultiQuote





|