Hi everyone, tried to display next and previous records using Next and Previous buttons but unable to do so. The record displayed is the current record whenever i click the Next or Previous buttons ie it doesn't move to the next or previous records. Below is the coding. Please advise. Thanks.
<form name="progress" id="progress" method="post" action=""> <td colspan="2"><input type="submit" name="prev" id="prev" value="Previous" class="btnSubmit"></td> <td colspan="2"><input type="submit" name="next" id="next" value="Next" class="btnSubmit"></td> </form>
<?php
error_reporting(E_ALL ^ E_NOTICE);
mysql_connect("localhost","user","");
mysql_select_db("pq");
$_SESSION['userid']; // it will print the userid value
$_SESSION['username']; // it will print the userid value
$_SESSION['usersecurity']; // it will print the userid value
$picid = 0;
if(isset($_POST['next']))
{
$picid=$picid++;
$que = mysql_query("select * from general,progress where picid ='$picid'");
$data = mysql_fetch_array();
$userid= $data["userid"];
$year= $data["year"];
$kra= $data["kra"];
$kpi= $data["kpi"];
$progress1= $data["progress1"];
$Rating1= $data["Rating1"];
$picid = $data["picid"];
}
if(isset($_POST['prev']))
{
$picid=$picid--;
$que = mysql_query("select * from general,progress where picid ='$picid'");
$data = mysql_fetch_array();
$userid= $data["userid"];
$year= $data["year"];
$kra= $data["kra"];
$kpi= $data["kpi"];
$progress1= $data["progress1"];
$Rating1= $data["Rating1"];
$picid = $data["picid"];
}
?>