Please help I'm new in coding php mysql This code is giving me errors like:
Notice: Undefined index: name in C:\Program Files\EasyPHP-5.3.9\www\Authentication1\update1_ac.php on line 15
Notice: Undefined index: surname in C:\Program Files\EasyPHP-5.3.9\www\Authentication1\update1_ac.php on line 15
Notice: Undefined index: contact_number in C:\Program Files\EasyPHP-5.3.9\www\Authentication1\update1_ac.php on line 15
Notice: Undefined index: email in C:\Program Files\EasyPHP-5.3.9\www\Authentication1\update1_ac.php on line 15
Notice: Undefined index: position in C:\Program Files\EasyPHP-5.3.9\www\Authentication1\update1_ac.php on line 15
Notice: Undefined index: user_name in C:\Program Files\EasyPHP-5.3.9\www\Authentication1\update1_ac.php on line 15
Notice: Undefined index: password in C:\Program Files\EasyPHP-5.3.9\www\Authentication1\update1_ac.php on line 15 ERROR can not update data
This is the code
<?php
    $host="localhost"; // Host name 
    $username="root"; // Mysql username 
    $password=""; // Mysql password `enter code here`
    $db_name="administrator"; // Database name 
    $tbl_name="players"; // 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");
    if (isset($_POST['submit'])){
// update data in mysql database 
    $sql="UPDATE $tbl_name ports SET name='".$_POST['name']."', Surname='".$_POST['surname']."', contact='".$_POST['contact_number']."', email='".$_POST['email']."', position='".$_POST['position']."', user_name='".$_POST['user_name']."', password='".$_POST['password']."' WHERE id='".$_POST['player_id']."'";
    $result=mysql_query($sql);
// if successfully updated. 
    if(!empty($result)){                     //The error is here
    echo "Successful";
    echo "<BR>";
    echo "<a href='list2_player.php'>View result</a>";
        }
    }
    else {
    echo "ERROR can not update data";
        }
    ?>
 
     
     
     
     
    