:mad:😕
Hey guys. I've made a little menu that displays all the names in my database in a select menu style format. I'm tryinggg to get this to work and its very frustrating.
On page one I've made a POST form where you select the name you want and submit your query. This is page 2 of the form. Here's what I know:
1) When the string is exploded the two elements, first and last are being displayed properly.
2) When the db is queried using the names themselves and not varibles for the names this works fine.
//assume proper db connection
error_reporting(E_ALL);
$x = $_POST['Last_First'];
$names = explode(',',$x);
$first = $names[1];
$last = $names[0];
$blah = $db->queryOne("SELECT ShareholderID FROM ShareholderNames WHERE First_Name = $first AND Last_Name = $last");
echo $blah;
This returns MDB2 Error: no such field.
HOWEVER, when I use the exact same code, but I switch out $first and $last with actual values it works. I should note that I have echoed $first and $last to make sure they are sending proper values to the query and they are. What am I missing? As always, thanks for your time guys!