I made a custom function to select data from database using WP methods. It looks like this;
function CheckUser($name){
/*DB connection */
$result = $mydb->get_results("SELECT *FROM users WHERE name = ".$name.";");
if(!empty($result)){
echo "OK!";
}
}
And here is a part in code:
/*This part is in foreach so thats why I am using $obj
$name_string = $obj->first_name." ".$obj->surname;
Prombutne($name_string);
But every time I not receive anything from DataBase, when I change !empty to empty I get OK so Select function always return's empty.