please assist here, it says:
Notice: Undefined index: player_id in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 16
Notice: Undefined index: name in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 17
Notice: Undefined index: surname in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 18
Notice: Undefined index: contact_number in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 19
Notice: Undefined index: email in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 20
Notice: Undefined index: position in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 21
Notice: Undefined index: username in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 22
Notice: Undefined index: password in C:\Users\Motsethebe\Documents\easyPHP\www\Projects\test\update_player.php on line 23
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 12
code:
<?php
$config="config.php";
if(file_exists($config)){
include($config);
}else{
echo "file error";
}
$connection = mysql_connect($host,$user,$pass);
if($connection){
$select_db=mysql_select_db($db,$connection) or die(mysql_error());
}else{
die(mysql_error());
}
$player_id = $_GET['player_id'];
$name = $_GET['name'];
$surname = $_GET['surname'];
$contact_number= $_GET['contact_number'];
$email = $_GET['email'];
$position = $_GET['position'];
$username = $_GET['username'];
$password = $_GET['password'];
$query = "UPDATE
list_players
SET
name='$name',
surname='$surname',
contact_number='$contact_number',
email='$email',
position='$position',
username='$username',
password='$password'
WHERE
player_id=$player_id";
$result=mysql_query($query) or die(mysql_error());
if($result){
echo "Updated";
}else{
echo "error updating record";
}
?>
<br /><a href="list_players.php">List Players</a>|<br /><a href="insert_player.php">Insert Player</a>