Friday, 27 September 2013

Fixing PHP undefined index errors

Fixing PHP undefined index errors

$id_cust = $_POST['id_cust'];
$username = $_POST['username'];
$sql = ("UPDATE customer SET username = '$username' WHERE id_cust =
'$id_cust'");
mysql_select_db('dbisupply');
$retval = mysql_query( $sql, $conn );
if(! $retval )
The error is undefined index in id_cust.
What is the problem with this code ? The query seems correct.

No comments:

Post a Comment