Jump to content

Error on Last and - records


kniggles

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.