PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I don't quite understand what is going on here. I have this code that captures post data and inserts it into a database query based on fields it pulls from a table with a describe query..
foreach ($this->userAnswers AS $key => $value)
{
if (in_array($key, $this->tableFields))
{
$this->data[$key] = $value;
echo 'FOUND FIELD ' . $key . "<br>";
} else {
echo 'COULD NOT FIND ' . $key . ' Field<br>';
}
}
The problem is that it's returning true on some fields and false on others even though they all exist. The case is the same, they are all text strings. They are all there
[userName] => myusername
COULD NOT FIND userName Field
[TravelDistance] => 55
FOUND FIELD TravelDistance