fork download
  1. <?php
  2.  
  3. // Достал студента из БД по паролю
  4. $student = $db->isPswrdInDB($password);
  5.  
  6. // код обработки запроса сверху:
  7. public function isPswrdInDB($password)
  8. {
  9. $sql = "SELECT * FROM students WHERE password= :password";
  10. $cpswrd = $this->db->prepare($sql);
  11. $cpswrd->bindValue(':password', $password);
  12. $cpswrd->execute();
  13. $student = $cpswrd->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, "student");
  14. if (count($cpswrd) > 0) {
  15. return $student;
  16. } else
  17. return false;
  18.  
  19. }
  20.  
  21.  
  22.  
Runtime error #stdin #stdout #stderr 0.02s 24400KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'public' (T_PUBLIC) in /home/Gum4oU/prog.php on line 7