Need help/w Page: 1,2,3,4 function!


Posted on 16th Feb 2014 07:03 pm by admin

So I have this code im working on where it's ment to display seperate pages having 20 logs each
I'm having SOOOOOOOOO much trouble with it... it's supposed to work! >,<

I get the right amount of Pages 1,2,3,4, but when I click on them it doesn't show up right =(

http://www.clan-wd.com/test.php


<?php
include "config.php";



if($page == NULL) {
$page = 0;
} else {
$page = $page - 1;
}
global $myrow;
extract($myrow);


if($p == "") {

echo "<table width='100%' border='3'>";

// Counting Codes #########
$result = @mysql_query("SELECT COUNT(*) FROM logs");
$count = mysql_fetch_array($result);
$count = $count[0];

$num_pages = ($count / 20) + 1;
$limit = 20 + $startNum * 20;
$i = 0;


$result = @mysql_query("SELECT * FROM logs ORDER BY id DESC");
while(($row = mysql_fetch_array($result)) && $i <= $limit) {
extract($row);

if($i >= ($startNum * 20)) {
echo "
<tr><td><b>$id - $logName</b> $date</td></tr>
";
}
$i++;
}
echo "
</table>
<p align=left><b>Page:</b>
";
for($i = 1; $i <= $num_pages; $i++) {
echo "<a href=test.php?page=$i>$i</a>";
}

}


?>

No comments posted yet

Your Answer:

Login to answer
311 Like 48 Dislike
Previous forums Next forums
Other forums

remove innitial

and

tags
i am using tiny_mce as a text editor for my CMS.
buy now the problem is it add <p>

DateTimeZone::listIdentifiers headache
http://php.net/manual/en/datetimezone.listidentifiers.php


So the documentation states tha

[PHP HELP] Php order form.
Hello to everyone @ phpfreaks. Im new to this site and hope to learn lots of things here.

Fir

Simple Scraper... Weird Output
Okay, maybe I just need a Blue Monster and some sleep, but....

I'm scraping a ringtone site

problem with script manager
Hi iam using Net.2005.I have created ajax enabledwebsite.i have master page in which i have script m

How to Create a Dynamic table
col1 col2 date1 date2 date3 date4..........
a b v1 v2 v3 v4

[newb] Image hosting help.
Hey there, I'm new to php, I know some basics and i can code PWN, I'm only 14 but I'm interested in

Using CSS to format MySQL query
Hi,

If i want to have a news page on my site, which displays all records of a table in descen

Insert Failing.
Hey,
I am making a Sign up page for a website, but the insert query into the Database does not se

Code working in IE but not FireFox
I created a dynamic navigation list for my website based off of a table in my database. The code is

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash