Topic: {help needed} - using msql and php to display records
Hi i would like to know why my code isn't storing information into the stated variables after ive clicked the next record button
<?php
$sql=mysql_query("SELECT *FROM clients WHERE id > 0 ORDER BY id ASC LIMIT 1");
$row=mysql_fetch_array($sql);
$id=$row['id'];
$FirstName=$row['FirstName'];
$Surname=$row['Surname'];
$DOB=$row['DOB'];
$Nationality=$row['Nationality'];
?>
And when i press the "Next record" button, the data inside the previous variables should change but it doesn't
<?php
if($_REQUEST['chngRecord'] == 'Next Record')
{
$sql=mysql_query("SELECT *FROM clients WHERE id > {$id} LIMIT 1");
$row=mysql_fetch_array($sql);
$id=$row['id'];
$FirstName=$row['FirstName'];
$Surname=$row['Surname'];
$DOB=$row['DOB'];
$Nationality=$row['Nationality'];
echo $id;
}Last edited by Hoax (November 20, 2011 20:07)