I am trying to fetch the values of updated records from dp. Let me brief this-
1.I have two while loops ,one for displaying the records from database and second to fetched after edit operation.
2.After editing 1 of the fields the record should be updated in database [i have successfully updated record/records too in db ] but the problem is its updating successfully in database [ as i do have checked my db as i update record] but the records are not displayed of updated records. I think it does not enter the while loop of update query.
Please suggest some solution.
if(isset($_POST['recruiter_s_by_code'])
{
//some code here...the query here is being a sucesss
//SELECT STATEMENT here..
}
if(isset($_POST['recruiter_s_by_mail'])
{
//some code here...the query here is being a sucesss
//SELECT STATEMENT here..
}
if(isset($_POST['recruiter_s_by_name'])
{
//some code here...the query here is being a sucesss
//SELECT STATEMENT here..
}
if(isset($_POST['recruiter_s_by_code']) || isset($_POST['recruiter_s_by_name']) || isset($_POST['recruiter_s_by_mail']))
{
$result=mysql_query($sql);
echo "in result"
while($row=mysql_fetch_array($result))
{
$viewrecruiter0=$row['recruiter_did'];
$viewrecruiter1=$row['recruiter_name'];
$viewrecruiter2=$row['recruiter_mail'];
}
}
else
{
if(isset($_GET['var']))
{
$id1=$_GET['var'];
echo $id1;
}
//$query1=UPDATE .......SET......WHERE... ->the update too is a success for me.
$res=mysql_query($query1);
while($row=mysql_fetch_array($res))
{
$viewrecruiter00=$row['recruiter_did']; //by code
$viewrecruiter01=$row['recruiter_name'];
$viewrecruiter02=$row['recruiter_mail'];
}
}
?>
The query of UPDATE is running successfully but the records are not displayed after UPDATE click. Only the Label are being displayed but not the values.
$id1in your update you are open to SQL injections. The mysql_ functions are outdated, you should use PDO or mysqli_.