Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]Unexpected $this po foreach
NickOver
post
Post #1





Grupa: Zarejestrowani
Postów: 332
Pomógł: 10
Dołączył: 13.03.2014
Skąd: Bydgoszcz

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


Cześć,
Mam błąd którego istnienia za bardzo nie rozumiem. Oto kod:
  1. public function remove($table = NULL, $parameters = NULL){
  2. $this->setTable($table);
  3. if($parameters === NULL){
  4. $this->displayError('You must specific parameters to use this method');
  5. exit();
  6. }
  7. if (is_array($parameters)){
  8. $whereString = null;
  9. foreach ($parameters as $field => $value){
  10. if (empty($whereString)){
  11. $whereString = " WHERE ".$field." = '".$value."'";
  12. } else {
  13. $whereString.= " AND ".$field." = '".$value."'";
  14. }
  15. }
  16. $this->_query = $this->_connection->prepare("DELETE FROM "$this->_table.$whereString);
  17. } else {
  18. $this->_query = $this->_connection->prepare("DELETE FROM "$this->_table.$paraqmeters);
  19. }
  20. return $this->_query;
  21. }

Php wywala mi "Unexpected $this ..." przy "$this->_query = $this->_connection->prepare". Wiecie może czemu?
Go to the top of the page
+Quote Post

Posty w temacie
- NickOver   [php]Unexpected $this po foreach   15.06.2015, 20:58:28
- - Szymciosek   Źle łączysz stringi. Przyjrzyj się   15.06.2015, 21:01:26
- - NickOver   Kropka... Dzięki wielkie   16.06.2015, 18:48:15


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: 28.09.2025 - 12:34