Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Help me?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Forget" data-source="post: 181303" data-attributes="member: 14824"><p>Hello, </p><p>Okay so the issue i have is making pages for my information, i want to split my code into different pages depending on what the page id is from a get request. I simply have no idea to work out how to code this haha. What i have done so far as a trying, not sure if it works, havn't tested it.</p><p> </p><p><?php</p><p>//gets the id (index.php?id={this}) and filters</p><p>$id = filter($_GET['id']);</p><p> </p><p>//results per page</p><p>$results = 20;</p><p> </p><p>//query for getting comments</p><p>$q = mysql_query("SELECT * FROM news_comments WHERE new_id = '{$id}'");</p><p> </p><p>//counts amount of comments</p><p>$c = mysql_num_rows($q);</p><p> </p><p>//Works out how many pages i will need</p><p>$pageamount = ceil($c/$results);</p><p> </p><p>//Finds get page and if blank uses 1</p><p>if(!isset($_GET['page'])) { $page=1; }else{ $page=$_GET['page']; }</p><p>?></p><p> </p><p>Don't know from here? haha anyone help me?</p><p>I could use limit but that would only work for the first page.</p></blockquote><p></p>
[QUOTE="Forget, post: 181303, member: 14824"] Hello, Okay so the issue i have is making pages for my information, i want to split my code into different pages depending on what the page id is from a get request. I simply have no idea to work out how to code this haha. What i have done so far as a trying, not sure if it works, havn't tested it. <?php //gets the id (index.php?id={this}) and filters $id = filter($_GET['id']); //results per page $results = 20; //query for getting comments $q = mysql_query("SELECT * FROM news_comments WHERE new_id = '{$id}'"); //counts amount of comments $c = mysql_num_rows($q); //Works out how many pages i will need $pageamount = ceil($c/$results); //Finds get page and if blank uses 1 if(!isset($_GET['page'])) { $page=1; }else{ $page=$_GET['page']; } ?> Don't know from here? haha anyone help me? I could use limit but that would only work for the first page. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Help me?
Top