hiii
i hv tried updating a database table frm the form bt it is not getting updated can u suggest me some php code for updating the database values
i hv used the following code
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="root"; // Mysql password
$db_name="project"; // Database name
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="root"; // Mysql password
$db_name="project"; // Database name
$tbl_name="add_marks"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// update data in mysql database
$sql="UPDATE $tbl_name SET Studentid='$Studentid' WHERE id='$id'";
$result=mysql_query($sql);
// if successfully updated.
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='edit_marks.php'>View result</a>";
}
else {
echo "ERROR";
}
?>
it is coming successfull bt the values r nt changing in the database can u guide me in this pls