Hello, please advise problem with code. Thanks.
<HTML>
<body bgcolor="#ccfff"><center>
<form name="form" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
Select state/rate <SELECT name=point>
advise me
<OPTION class=highlight value=9>paypal
<OPTION class=highlight value=10>ebay
<OPTION class=highlight value=32>amazon
</SELECT><p>
<CENTER><input type="submit" name="submit" value="submit"><p>
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
$dbconnect = mysqli_connect('localhost','root','cookie');
if($dbconnect == false) {
throw new Exception("Connect failed: ".mysqli_connect_error());
}
if(mysqli_select_db($dbconnect, 'homedb') == false) {
throw new Exception("Select DB failed: ".mysqli_error($dbconnect));
}
$point = (isset($_POST['submit'])) ? mysqli_real_escape_string($dbconnect, $_POST['point']) : '';
$id = (isset($_POST['id'])) ? mysqli_real_escape_string($dbconnect, $_POST['id']) : '';
$result = mysqli_query($dbconnect, "SELECT * FROM emailtbl");
if (!empty($_POST['id']) ($_POST['update_target'])) { [B]// Parse error: syntax error, unexpected '('[/B]
$sql = "UPDATE emailtbl SET point = '$point' WHERE id ='$id'";
$update = mysqli_query($dbconnect, $sql);
if($update == false) {
throw new Exception("Update query failed: ".mysqli_error($dbconnect).PHP_EOL.$sql);
}
echo "submittal set for ".mysqli_affected_rows($dbconnect)." row(s).";
}
else { echo "'update_target' was not set, so no update attempted."; }
?>
</form></body></html>