Jump to content

Problem in update records


asad_black

Recommended Posts

em facing problem in update records.

 

form submit successfully nut records is not updating. i dont whats the problem.

 

kindly solve my problem as soon as possible

 

 

this is form page

 



<form id="form1" name="form1" method="post" action="update_teacher_records_process.php">
<p>Name :
<!-- name of this text field is "name" -->
<input name="teachername" type="text" id="teachername" value="<? echo $row['teachername']; ?>"/>
<br />
Email :
<!-- name of this text field is "email" -->
<input name="cellno" type="text" id="cellno" value="<? echo $row['cellno']; ?>"/>
<br />
Tel :
<!-- name of this text field is "tel" -->
<input name="residentialadd" type="text" id="residentialadd" value="<? echo $row['residentialadd']; ?>"/>
</p><br><br>

<input name="tuition_asg" type="text" id="tuition_asg" value="<? echo $row['tuition_asg']; ?>"/>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>



 

 

this is my update code

<?PHP 

include("admin_conn.php");






// Get parameters from form.
$teachid=$_POST['teachid'];
$teachername=$_POST['teachername'];
$cellno=$_POST['cellno'];
$residentialadd=$_POST['residentialadd'];
$tuition_asg=$_POST['tuition_asg'];

// Do update statement.
mysql_query("UPDATE teachers set teachername='$teachername', cellno='$cellno', residentialadd='$residentialadd', tuition_asg='$tuition_asg' where teachid='$teachid'");

// Re-direct this page to select.php.
header("location:view_teacher_records.php");
exit;

?>


 

datatype in database is text.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/173779-problem-in-update-records/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.