Page 1 of 1

paging an article

Posted: Thu Oct 07, 2004 11:19 am
by dizeta
hi,

i've this script :

Code: Select all

<?php

include("../pannello/dbconnect.php");


require("../pannello/codeLighter.class.php");
$codeLighter = new codeLighter();


$query = "SELECT studi.*,......... 
WHERE titolo_studio = '" . $_REQUEST["id_studio"]  . "'";

          
$select = mysql_query($query) or die(mysql_error());


$ultimo_studio="";
while($result = mysql_fetch_array($select))  {
    if ($result["id_studio"] != $ultimo_studio) {

 <p><strong>".$result["titolo_sommario"]."</strong></p>
             <p>".$result["corpo_sommario"]."</p>
 <p><strong>".$result["titolo_documento"]."</strong></p>
 <p>". $codeLighter->convert( htmlentities($result["corpo_documento"]))."</p>
 <p><strong>". $result["titolo_analisi"]."</strong></p>
 <p> ". $codeLighter->convert( htmlentities($result["corpo_analisi"]))."</p>
 <p style="font-size:1.3em;font-weight:bolder">". $result["titolo_educatori"]."</p>
 <p>". $codeLighter->convert( htmlentities($result["corpo_educatori"]))."</p>
 <p style="font-size:1.3em;font-weight:bolder">". $result["titolo_utenti"]."</p>
 <p>". $codeLighter->convert( htmlentities($result["corpo_utenti"]))."</p>  
 <p style="font-size:1.3em;font-weight:bolder">". $result["titolo_approf"]."</p>";


}
echo "<p>". $codeLighter->convert( htmlentities($result["approfondimento"]))."</p>";
$ultimo_studio = $result["id_studio"];
} 

?>
I extract and print all records that i have into the table to build an whole article.
question: how can i paging this article? i mean is too long to show it in a single page. i'd like to divide it dynamically , but i'm a newbie and i don't know how to do it.

note: i've found tutorials, but "all Number of result to show per page". what i need is different ( i suppose)
thanks for help

Posted: Thu Oct 07, 2004 11:22 am
by feyd
maybe you're talking about pagination?

[big_search]pagination[/big_search]

Posted: Thu Oct 07, 2004 1:09 pm
by twigletmac
Most of what you would be doing is related to the tutorials you have found - the different part is you need to break up your article in some way, you need to decide how you're going to determine where a page break is.

Mac