Jump to content

Recommended Posts

here is something wrong may be i am not getting

it's only showing me 2 results

on

http://localhost/proj/admin/view.php

and

http://localhost/proj/admin/view.php?page=1

 

after that when i press page 2 link

http://localhost/proj/admin/view.php?page=2

 

on this link it shows me all results from 2 to 6 it want to show result me from 4 to 6

and on 3rd page show 2 to 8 mean my $pstart is not changing what i do now ? where is m doing mistake

or on simple view.php

 

where m doing mistake someone guiade

 

 

 

<?php

include "inc.php";

$limit = 2;

$que = "SELECT * FROM catg";

$exe = mysql_query($que);

$num = mysql_num_rows($exe);

$pages = $num/$limit ;

?>

<table>

 

<tr>

<td valign="top"><?php include "menu.php"; ?></td><td>

<?php

$pend = $limit;

$pstart = 0;

if($_GET['page'])

{

 

$pstart = $limit ;

$page = $_GET['page'];

$pend = $limit*$page;

 

}

$que2 = "SELECT * FROM catg limit $pstart,$pend";

$exe2 = mysql_query($que2);

echo "<table><tr><td>Category</td><td>Action</td></tr>";

while ($get = mysql_fetch_array($exe2)){

 

echo"<tr><td>".$get['cat']."</td><td><a href='delc.php?id=".$get['id']."'>delete</a>

 

<a href='editc.php?id=".$get['id']."'>Edit</a></td></tr>";

 

 

}

echo "</table>";

 

?>

 

</td>

</tr><tr><td><?php for($i=1; $i<=$pages; $i++ )

echo "<a href='view.php?page=$i'>$i</a>"; ?>

</td></tr>

</table>

Link to comment
https://forums.phpfreaks.com/topic/206767-page-nevigation/
Share on other sites

just so you know..

only YOU Can see this page

http://localhost/proj/admin/view.php

 

if you want others to access it and look at it you need to replace the LocalHost with your IP Address

you can see your IP in the right side of your posts

or By Clicking Here

Link to comment
https://forums.phpfreaks.com/topic/206767-page-nevigation/#findComment-1081962
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.