We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Another Question!
Topic Started: Mar 30 2005, 12:06 PM (244 Views)
Dennis
Member Avatar
Member
[ *  *  *  *  *  *  * ]
On the member list, there is a dropdown box to choose which page you want to view. How could I add this to my script? This is what I have so far, and it all works fine:

Quote:
 
<?php

$start = $_GET['start'];
if(!isset($start))
  {
  $start = 0;
  }

$result = mysql_query("SELECT * FROM `y_2005` ORDER BY `last` ASC LIMIT ".$start.", 30");

echo '<form method="get">';
echo ' Page Number: <select name="start">';
echo '  <input type="Submit" value="Go!"><br /><br />';

if($result  && mysql_num_rows($result) > 0)
{
while ($row = mysql_fetch_assoc($result))
{
echo "<tr><th width=10%>{$row['year']}_{$row['id']}</th><th width=20%>{$row['last']},
{$row['first']}</th><th width=20%>{$row['date']}</th><th width=20%>{$row['pc']}</th><th width=15%>{$row['type']}</th></tr>";
}
}
?>


Thanks.


P.S., We need a Matthew Smiliee. :)
Offline Profile Quote Post Goto Top
 
kingy
1 in 10 people understands binary, the other 1 doesn't
[ *  *  *  *  *  * ]
you mean what to order by? if so in the fetch query, have it order by a variable called $Order, then your dropdown can link to page.php?order=LAST

then it will do as you say

i think thats what you mean
Offline Profile Quote Post Goto Top
 
Dennis
Member Avatar
Member
[ *  *  *  *  *  *  * ]
No, I have a large database, upwards of two-thousand rows.

I need a view all page, but obviously, two thousand on one page is rediculous, so I want to split it into pages. I know how to do that, but I can't get the page numbers working.
Offline Profile Quote Post Goto Top
 
Dennis
Member Avatar
Member
[ *  *  *  *  *  *  * ]
Anyone?
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Create a free forum in seconds.
« Previous Topic · Technology Chat · Next Topic »
Add Reply