
-----------------------------------
Amailer
Tue Jul 08, 2003 10:50 am

Displaying page (like google...)
-----------------------------------
You know if you search for a result and there are over...idk over 10 or 20, Google displays the page numbers? And click them and you go to the page which displays the result, i want to know how to creat something like that.

Any help?

-----------------------------------
Amailer
Tue Jul 08, 2003 11:06 am


-----------------------------------
NEVER MIND CLOSE THIS,
I already made my own, heeh took a bit but i figured it out :)

-----------------------------------
Evil_striker
Tue Jul 08, 2003 12:53 pm

GOOD FOR U
-----------------------------------
U found out on your OWN!

-----------------------------------
Homer_simpson
Tue Jul 08, 2003 1:22 pm


-----------------------------------
care to share...?

-----------------------------------
Amailer
Tue Jul 08, 2003 1:26 pm


-----------------------------------
With help from another site (well it really is editied for my use)
i made this:


....
$order_by = "ORDER BY 'id'";
$sort_order = "DESC";



//select a row here and so we can move on
$query = "SELECT count(*) FROM news";
if(!$query) error_message(sql_error());

$result = mysql_query($query);


//Then lets display the number of logs
//after that we will put a limit to the page

$query_data = mysql_fetch_row($result);
$total_num_user = $query_data[0];

$query1= "SELECT * FROM news";

$numresults=mysql_query($query1);
$numrows=mysql_num_rows($numresults);



if (empty($offset))
{
$offset=0;
}




// The continuing next-prev code

$pages=intval($numrows/$limit);

if (($pages!=0 and $pages!=1) or ($pages==1 and ($numrows%$limit)))
{
if ($offset!=0)
{
$prevoffset=$offset-$limit;
$dis .=  "Previous ";
}

if ($numrows%$limit)
{
$pages++;
}

for ($i=1;$i