Forum Moderators: coopster

Message Too Old, No Replies

pagination.

how to?

         

abeerbd

4:19 pm on Jun 18, 2011 (gmt 0)

10+ Year Member



Hi there

<?php mysql_connect('localhost', 'ash', 'lash') or die('Connection Failed');
mysql_select_db('lash') or die('Database not found');
$id = (int) $_GET['id'];
$result = mysql_query("SELECT title, dtl, meta_description, meta_keywords FROM page WHERE id=$id");
if (!mysql_num_rows($result)) { header('Location: 404.php', true, 404);
die();}$row = mysql_fetch_array($result);$title = stripslashes($row['title']);
$dtl = stripslashes($row['dtl']);$meta_desc = stripslashes($row['meta_description']);$meta_keys = stripslashes($row['meta_keywords']);?><html><head><meta name="description" content="<?php echo $meta_description; ?>" /><meta name="keywords" content="<?php echo $meta_keywords; ?>" /><title>MySite.com - <?php echo $title; ?></title></head><body><h1><?php echo $title; ?></h1><?php echo $dtl; ?></body></html>


here is my script. this script is only for to pull data from mysql database. which is depend on url variable

like if url is www.mysite.com/?id=2
then it display data from the musql databse where id is 2.

but if my id=2 is full of text like 50 paragraphs then i need pagination. how can do this?

rocknbil

3:30 pm on Jun 20, 2011 (gmt 0)