I am newbie in PHP+MySQL and learn it myself. I got some problem (i suppose it may be very simple and stupid) but i can't fix it. OK. I want to select some record from my database: I use the function to connect to database:
   function connect_bd() {
   $result = new mysqli('localhost', 'root', '*****', 'book_kz');
   if (!$result) {
      return false;
   } else{
    $result->autocommit(TRUE);
   return $result;
}
}
it works properly. Then i wrote verification function:
function log_in($user_name, $passwrd) {
//  verification of user's name and password in database
// if yes - return true
// otherwise - false
  // connect to database
  $connect = connect_bd();
  if (!$connect) {
     return 0;
  }
  // verification procedure
  $result = $connect->query("select * from admin
                         where user_name='".$user_name."'
                         and passwrd = sha1('".$passwrd."')");
  if (!$result) {
   echo "Incorrect password!".$connect->mysqli_errno;
// return to logging in menu
create_html_url("logo_in.php", "Return to logging menu");
return 0;
     }
  if ($result->num_rows>0) {
     return 1;
  } else {  
     return 0;
  }
$connect->close();
}
It doesn't work. Especially something is going wrong with $connect->query.
I put query "select * from admin where user_name =...." directly into MYSQL environment - it works correctly. But $result = $connect->query("select... shows nothing. I inserted next commands echo "</br> print something</br>"; and echo "</br>print something".$result."</br>";. First command shows me string print something and next one shows nothing! It is looking like failure of $result blocks printing. I've checked a some samples about mysqli::query and didn't found anything wrong. I will be very appreciated anybody ready to help me. Thank you in advance....
 
    