Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Składnia
teez
post
Post #1





Grupa: Zarejestrowani
Postów: 186
Pomógł: 6
Dołączył: 20.12.2010

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


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..


Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
Spawnm
post
Post #2





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




'where' => 'bid = \'$this->request[\'id\']\''
Go to the top of the page
+Quote Post
teez
post
Post #3





Grupa: Zarejestrowani
Postów: 186
Pomógł: 6
Dołączył: 20.12.2010

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


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

Ten post edytował teez 1.04.2013, 13:26:09
Go to the top of the page
+Quote Post
Spawnm
post
Post #4





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




Ok, daj 'where' => 'bid = '.$this->request['id']
i binduj dane (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
+Quote Post
teez
post
Post #5





Grupa: Zarejestrowani
Postów: 186
Pomógł: 6
Dołączył: 20.12.2010

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


Podziękował. (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

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: 22.08.2025 - 20:55