So I am trying to see if a set of numbers is in an array.
array(3) {
[0]=> array(2) {
["account_ID"]=> string(10) "1781890863"
[0]=> string(10) "1781890863"
}
[1]=> array(2) {
["account_ID"]=> string(10) "2093832999"
[0]=> string(10) "2093832999"
}
[2]=> array(2) {
["account_ID"]=> string(10) "2147483647"
[0]=> string(10) "2147483647" }
}
I have the array and the values are all there and everything is just dandy. But when I compare using in_array it returns false. I don't quite know why.
class DB(){
public function getAllID(){
$result_row = $this->accessDB( 'SELECT account_ID FROM users;');
return $result_row;
}
}
That is the function that I am using to access the database and return the array and then
$app = new DB();
if(isset($_GET['user'])){
if(in_array($_GET['user'],$app->getAllID())){
include('account.php');
echo 'Account DOES exist';
} else {
var_dump($app->getAllID());
echo '<br/>'.$_GET['user'].' does NOT exist.';
}
}
Does anyone see why my code here won't work maybe I am just accessing the DB wrong?
var_dum($app->getAllID());Is above.