Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Składnia
Forum PHP.pl > Forum > Przedszkole
teez
Witam,

Problem pewnie błahy ale próbowałem już różne kombinacje i ciągle sypie błędami :

Kod
              $id = $this->request['id'];
                $result = $this -> DB -> build(array(
                    'select' => 'COUNT(*) as bid',
                    'from'   => 'pg_komentarze',
                    'where'  => 'bid = '$this->request['id']''
                )
                );


Parse error: syntax error, unexpected T_VARIABLE, expecting ')' in \karta\karta.php on line 35 ( linia z where )

Próbowałem 'where' => 'bid = $id', ''bid' = '$id', 'bid = '.$id.', i dalej nic..


Spawnm
'where' => 'bid = \'$this->request[\'id\']\''
teez
Cytat(Spawnm @ 1.04.2013, 13:16:19 ) *
'where' => 'bid = \'$this->request[\'id\']\''

mySQL query error: SELECT COUNT(*) as bid FROM ibf2_pg_komentarze WHERE bid = '$this->request['id']'
Error: 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 'id']'' at line 1
Cytat(!*! @ 1.04.2013, 13:16:19 ) *
'where' => 'bid' = $this->request['id']


Parse error: syntax error, unexpected '=', expecting ')' in C:\xampp\htdocs\f\admin\applications_addon\other\panelgracza\modules_public\karta\karta.php on line 35
Spawnm
Ok, daj 'where' => 'bid = '.$this->request['id']
i binduj dane wink.gif
teez
Podziękował. smile.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.