I am trying to get certain matching records from my database. The code below works when I plug the value into a variable. However, when I get the value from $_POST, the value appears to be there but I cannot find any records!😕
The prints are only for testing.
Here is the code I use:
$emAction = $POST['emAction'];
$starts = $POST['starts'];
$contains = $_POST['contains'];
//$starts = 'cc';
print ("<h2>Action = $emAction</h2><br>");
print ("<h2>starts = $starts</h2><br>");
print ("<h2>contains = $contains</h2><br>");
require_once('includes/conndb.inc');
if ($starts != null) {
$query = "SELECT *
FROM tbemail
WHERE eMail LIKE '$starts%'
ORDER BY eMail";
print ("<h2>(2)starts = $starts</h2><br>");
}