Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Im using the code below suggested by another developer on this forum to limit the number of results per page and then navigate through them. The limit part limits the number of records that appear, the person then suggested that I turn 0 into a variable, they then refer to 0 as $start so I am assuming they mean turn 0 into $start but when I do this and replace the 0 with $start the limit function doesnt work any more also when I add...
iif(!isset($_REQUEST['start']) ...... code the screen goes blank i think im puttin this in the wrong place or im not setting the variable correctly anyone got any ideas?
/* Performing SQL query */Code: Select all
<?php
$query = "SELECT * FROM people ORDER BY firstname LIMIT 0, 10";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
0= $start
if(!isset($_REQUEST['start']) || $_REQUEST['start']<0){
$start = 0;
}else{ $start = $_REQUEST['start'];
}
/*And this is to navigate through the records*/
<A HREF="script.php?start=<? echo $start + 10; ?>">Next</A>
?>Can anyone provide any help it would be much appreciated,
Thank you for your time.
patrikG | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]