Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][SQL] Problem z poleceniem w bibliotece PDO/języku SQL
muumiin
post
Post #1





Grupa: Zarejestrowani
Postów: 105
Pomógł: 0
Dołączył: 17.09.2014
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Mógłby mi ktoś wyjaśnić, co oznacza ten błąd?
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM users WHERE 'login'='asdfasdf'' at line 1' in C:\WebServ\httpd\startuj\templates\include\reg.php:31 Stack trace: #0 C:\WebServ\httpd\startuj\templates\include\reg.php(31): PDOStatement->execute() #1 {main} thrown in C:\WebServ\httpd\startuj\templates\include\reg.php on line 31

dołączam fragment kodu, który wydaje się być za to odpowiedzialny...

  1. $stmt = $db->prepare("SELECT FROM users WHERE 'login'=:login");
  2. echo '</br>sprawdzanie loginu:... ' . $login;
  3. $stmt->bindValue(":login", $login, PDO::PARAM_STR);
  4. $stmt->execute(); //linia 31


Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 18.09.2025 - 14:17