paging an article

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dizeta
Forum Commoner
Posts: 47
Joined: Mon Feb 02, 2004 9:53 am

paging an article

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

maybe you're talking about pagination?

[big_search]pagination[/big_search]
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply