I want to search in mysql table with specific column by using foreach with key value.
My code is:
$query= "select status from temp where id='1'";
$result=$oDbh->($query);
foreach($result AS $k => $v) {
if($v['status']=='0' OR $v['status']=='1') {
return true;
}
else {
return false;
}
}
In table temp status is 2,0,1,1,1,0
.
If condition is searching only for first row and its returning false still there is 0 or 1 in table.
I am new here if there is more info needed than comment, please.