Jump to content

Recommended Posts

Hello ,

I am stuck trying to get this code to work,

every thing works well untill you try to go to the last record  or a negtive - number in the records.

 

-------------------------------------------------------

<?php
include('conect.php');
$page = (isset($_GET['page'])) ? $_GET['page'] : 1;
$startPoint = $page - 1;
$data = "SELECT * FROM table1 ORDER BY id ASC LIMIT $startPoint,1";
$query = mysql_query($data);
$data2 = mysql_fetch_array($query);
$rowCount = 0;
?><HTML><HEAD><TITLE></TITLE><META content="text/html; charset=utf-8" http-equiv=Content-Type><META name=GENERATOR content="MSHTML 9.00.8112.16457"><STYLE type=text/css>BODY {
	FONT-FAMILY: verdana, arial, sans-serif
}</STYLE></HEAD><BODY>
<P></P>
<P>
<FORM method=post action=display4.php>
<P></P>
<P></P>
Name: <INPUT value="<?php echo $data2[a]?>"> <INPUT value="<?php echo $data2[b]?>"> <INPUT value="<?php echo $data2[c]?>"><BR>
Club:  <BR>
hobby: 
<P><INPUT style="Z-INDEX: 132; POSITION: absolute; TOP: 67px; LEFT: 151px" value="<?php echo $data2[id]?>">
<P><INPUT style="Z-INDEX: 132; POSITION: absolute; TOP: 66px; LEFT: 313px" value="<?php echo $data2[timenow]?>">

<P><BR> </P>
<A href="display4.php?page=1">First</A>
 <A href="display4.php?page=<?php echo $page - 1?>">Prev</A>
 <A href="display4.php?page=<?php echo $page + 1?>">Next</A>
 <A href="display4.php?page=<??>hp echo $rowCount?;">Last</A>
</FORM>
<P></P></BODY></HTML>

I am thinking its something to do with this line

$data = "SELECT * FROM table1 ORDER BY id ASC LIMIT $startPoint,1";

any help please ?

thanks.

Link to comment
https://forums.phpfreaks.com/topic/279764-error-on-last-and-records/
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.