Sir, I am using these codes
if(isset($_POST['update']))
{
// Get values from form
$name=$_POST['name'];
$moba=$_POST['moba'];
$mobb=$_POST['mobb'];
$ptcl=$_POST['ptcl'];
$fax =$_POST['fax'];
$email=$_POST['email'];
$web =$_POST['web'];
$add =$_POST['add'];
$city =$_POST['city'];
$country =$_POST['country'];
$job =$_POST['job'];
$office =$_POST['office'];
$place =$_POST['place'];
$phone =$_POST['phone'];
$others =$_POST['others'];
if (empty($moba)){
echo "<script>alert('No username is selected')</script>";
}else{
$query = "UPDATE contacts SET name=$name mobb=$mobb ptcl=$ptcl fax=$fax email=$email web=$web address=$add city=$city country=$country job=$job office=$office place=$place phone=$phone others=$others where moba='".$_POST['$moba']."'";
$result = mysqli_query($con, $query)or die (mysqli_error());
//check update
if(!$result)
{
echo ("<script>alert('Sorry! Something went wrong.')</script>");
}else{
echo ("<script>alert('Record updated successfully')</script>");
}
}
but it says:
Notice: Undefined index: $moba in C:\wamp\www\Phonebook\contacts.php on line 110
and line 110 is
$query = "UPDATE contacts SET name=$name mobb=$mobb ptcl=$ptcl fax=$fax email=$email web=$web address=$add city=$city country=$country job=$job office=$office place=$place phone=$phone others=$others where moba='".$_POST['$moba']."'";
My database is as follows:
http://i44.tinypic.com/jpzwok.jpg
What I am doing wrong?
Please help me