public function search_artist($reg) { $regexp = "^[$reg]"; $this->artists = $this->pdo->query("SELECT id, nazwa FROM wykonawcy ORDER by nazwa ASC WHERE nazwa REGEXP '$regexp'"); // w tym miejscu mam błąd. return $this->artists; }
Nie wiem jak to ubrać w słowa, 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 'WHERE nazwa REGEXP '^[Y-Z]'' at line 1' in /home/vifus/public_html
Dzięki z góry!