ok here is the problem i retreive some information from my sql database e.g the name Dragon
require('query.php');
$details="select * from tutordetails WHERE p_id='".$_SESSION['id']."'";
$result=getQuery($details,$l);
while($row = mysql_fetch_array($result))
{
$forename=$row['forename'];
}
Dragon is presented into the input box
<span class="editInfo" id="forenameSpan">Forname:</span><input type="text" name="forename" id="forename" value="<?php echo $forename; ?>" />
the user changes the name from Dragon to Darren and presses the submit button to send it over to the insert function i created
the function sends back a confirmation that Darren has been saved
and to make sure that the information is different i get it to do a compar the posted name with the one saved on the database
if($forename==mysql_escape_string($_POST['forename']))
{
$message= "";
}
else if(edit($errormsg))
{
$message= "<h3>You have successfully edited your details</h3>";
}
else $message=$errormsg;
}
the problem is that the Dragon is there instead of Darren once the user presses the submit button, but Dragon shows up once the page is refreshed again e.g the user clicking the page link again