I'm trying to update a column value in a mysql table, but nothing is happening at all.
It's neither showing the update message nor the error message.
html form:
<html>
<form action='xyz.php' method='post'>
<input type='text' size='25' id='country' name='country'>
<input type='submit' id='submit' value='update'>
</form>
</html>
php code:
<?php
session_start();
$con=mysqli_connect("localhost","root","","server2go");
if(mysqli_connect_errno())
echo "<h2>Failed to connect to MySQL database!".mysqli_connect_errno();
if(isset($_POST['submit'])){
$country=$_POST['country'];
$userid=987654326;
$sql2=mysqli_query($con, "UPDATE user_profile set country='$country' WHERE userid='$userid'");
if(!$sql2){
die(mysqli_error($con));
echo "<h6>Failed to update</h6>";
}
else {
echo "<h5>Successfully updated!</h5>";
}
}
?>
what have i done wrong here?
plz help.