Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't fix the undefined index error
    text
    copied!<p>I have been surfing for a solution to this problem for awhile now and most of what I find is that people who aren't checking to see the the $_GET variable is set are the ones having this error. However, I do check if they are set yet I still come up with this error. Here is my code:</p> <pre><code>$customer_id = $_GET['customer_id']; $actual_customer_id = $_GET['actual_customer_id']; if (isset($_GET['customer_id'])&amp;&amp; $_GET['actual_customer_id']) { $query = "SELECT rewards_points.points,customers.id AS customerID, customers.email FROM rewards_points,customers WHERE rewards_points.customer_id= $customers_id AND $actual_customer_id = rewards_points.actual_customer_id"; } $query = "SELECT rewards_points.points,customers.id AS customerID, customers.email FROM rewards_points,customers"; </code></pre> <p>And the error is:</p> <pre><code>Notice: Undefined index: customer_id in /Applications/MAMP/htdocs/insertintotestt.php on line 14 Notice: Undefined index: actual_customer_id in /Applications/MAMP/htdocs/insertintotestt.php on line 15 [{"points":"20","customerID":"1","email":"someEmail@gmail.com {"points":"20","customerID":"2","email":"otherEmail@gmail.com"}, {"points":"10","customerID":"1","email":"aha238@gmail.com"}, {"points":"10","customerID":"2","email":"spgiegg@gmail.com"}, {"points":"15","customerID":"1","email":"aha238@gmail.com"}, {"points":"15","customerID":"2","email":"spgiegg@gmail.com"}, {"points":"25","customerID":"1","email":"aha238@gmail"}, {"points":"25","customerID":"2","email":"spgiegg@gmail.com"}] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload