troubleshooting Question

php undefined index

Avatar of jonofat
jonofat asked on
15 Comments1 Solution683 ViewsLast Modified:
I am getting an annoying undefined index error and can't figure out why?

$colname_Recordset1 = "-1";
if (isset($_POST['email'])) {
  $colname_Recordset1 = $_POST['email'];
mysql_select_db($database_test, $test);
$query_Recordset1 = sprintf("SELECT customerid, customeremail, customername, customerlastname FROM customers WHERE customeremail = %s", GetSQLValueString($colname_Recordset1, "text"));
$Recordset1 = mysql_query($query_Recordset1, $test) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

if (("" == ""))     {
  $updateSQL = sprintf("UPDATE customers SET random_token=%s WHERE customerid=%s",
                       GetSQLValueString($_POST['token'], "text"),
                       GetSQLValueString($_POST['customerid'], "int"));

  mysql_select_db($database_test, $test);
  $Result1 = mysql_query($updateSQL, $test) or die(mysql_error());

Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros