<?php
// Достал студента из БД по паролю
$student = $db->isPswrdInDB($password);
// код обработки запроса сверху:
public function isPswrdInDB($password)
{
$sql = "SELECT * FROM students WHERE password= :password";
$cpswrd = $this->db->prepare($sql);
$cpswrd->bindValue(':password', $password);
$cpswrd->execute();
$student = $cpswrd->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, "student");
if (count($cpswrd) > 0) { return $student;
} else
return false;
}
PD9waHAKCi8vINCU0L7RgdGC0LDQuyDRgdGC0YPQtNC10L3RgtCwINC40Lcg0JHQlCDQv9C+INC/0LDRgNC+0LvRjgokc3R1ZGVudCA9ICRkYi0+aXNQc3dyZEluREIoJHBhc3N3b3JkKTsKCi8vINC60L7QtCDQvtCx0YDQsNCx0L7RgtC60Lgg0LfQsNC/0YDQvtGB0LAg0YHQstC10YDRhdGDOgogcHVibGljIGZ1bmN0aW9uIGlzUHN3cmRJbkRCKCRwYXNzd29yZCkKICAgIHsKICAgICAgICAkc3FsICAgICAgICAgPSAiU0VMRUNUICogRlJPTSBzdHVkZW50cyBXSEVSRSBwYXNzd29yZD0gOnBhc3N3b3JkIjsKICAgICAgICAkY3Bzd3JkICAgICAgPSAkdGhpcy0+ZGItPnByZXBhcmUoJHNxbCk7CiAgICAgICAgJGNwc3dyZC0+YmluZFZhbHVlKCc6cGFzc3dvcmQnLCAkcGFzc3dvcmQpOwogICAgICAgICRjcHN3cmQtPmV4ZWN1dGUoKTsKICAgICAgICAkc3R1ZGVudCA9ICRjcHN3cmQtPmZldGNoQWxsKFBETzo6RkVUQ0hfQ0xBU1MgfCBQRE86OkZFVENIX1BST1BTX0xBVEUsICJzdHVkZW50Iik7CiAgICAgICAgaWYgKGNvdW50KCRjcHN3cmQpID4gMCkgewogICAgICAgICAgICByZXR1cm4gJHN0dWRlbnQ7CiAgICAgICAgfSBlbHNlCiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKCiAgICB9CiAgICAKICAgCiAgICA=