Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 02-16-2007, 08:33 AM   #1 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default Blog Pages

hey guyss, whatzz up..

yeah i m back again with a query, i jus want to know while i want to display the enteries from my blog, how to i scroll thru pages..

I mean i display the latest five on first page, then do i need to create manually all other pages??

or there is some technique with is followed ???

Thanks a lot
__________________
Realin Wuz here ...

real_in is offline  
Old 02-23-2007, 07:52 AM   #2 (permalink)
 
Newb Techie

Join Date: Dec 2006

Posts: 21

Stormdev

Default

Here is a technique using PHP with MySQL. I am sure that if your using some other language you can port the code to suit your needs.

http://www.devshed.com/c/a/PHP/Pagin...Data-with-PHP/

Hope this helped.
Stormdev is offline  
Old 02-23-2007, 10:04 AM   #3 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

hey lads, i got this technique and is working like a charm on my website..

you guys can also follow this technique

here is a snippet..

Code:
if(!isset($start))
{
	$start=0;
}

$eu=$start-0;
$limit=2;
$this1=$eu + $limit;
$back=$eu - $limit;
$next=$eu + $limit;


$sql="Select * from db_posts";

$result=mysql_query($sql);

$number=mysql_num_rows($result);

$query="select * from db_posts order by id desc limit $eu,$limit";

$res=mysql_query($query);



while($result=mysql_fetch_array($res))
{
	echo "".$result['ptitle']."";
	echo "<font size=2>,by ".$result['uname']."</font> 
";
	echo $result['pcontent']."
<hr>";
	}


if($back >=0)
 { 
print "<font face='Verdana' size='2'>PREV</font>"; 
} 

$i=0;
$lil=1;

	for($i=0;$i < $number;$i=$i+$limit)
	{
		if($i != $eu)
		{
			echo " <font face='Verdana' size='2'>$lil</font> ";
		}
		else 
		{ 
			echo "<font face='Verdana' size='4' color=red>$lil</font>";
		}        
		
			$lil=$lil+1;
	}

if($this1<$number)
{
	echo "NEXT";
	}
else
{
		echo"<font color=gray> No More Pages</font>";
		}
I am a new coder so you guys can very well judge mistakes, if any


thanks for ur consideration
__________________
Realin Wuz here ...

real_in is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On