Non-abstract method



    [B]Fatal error:[/B] Non-abstract method Sql::select() must contain body in [B]path[/B] on line 41


Zelim napraviti ovako:
ako se trazi sve, samo se upise: $klasa->select('tablica');
a pojedinacno ovako:
[code=php]<span class="syntaxdefault">$niz&nbsp;</span><span class="syntaxkeyword">=&nbsp;array(</span><span class="syntaxstring">'id'</span><span class="syntaxkeyword">=></span><span class="syntaxstring">'1'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'ime'</span><span class="syntaxkeyword">=></span><span class="syntaxstring">'neko&nbsp;ime'</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">$klasa</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">select</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'tablica'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$niz</span><span class="syntaxkeyword">);&nbsp;</span><span class="syntaxdefault"></span>[/code]

Jesam li dobro osmislio taj kod? Zasto ne radi?
[B]Fatal error:[/B] Non-abstract method Sql::select() must contain body in [B]path[/B] on line 41

Zelim napraviti ovako:
ako se trazi sve, samo se upise: $klasa->select(‘tablica’);
a pojedinacno ovako:

Jesam li dobro osmislio taj kod? Zasto ne radi?

Evo uredeni kod:

I to radi, ali sad sam probao prikazati to sa mysql_fetch_assoc, al to radi kad unesem jedan parametar (kad trazim samo po ID-u ili necem drugom). Kad stavim:
[php]$trazi = array(‘id’=>‘1’,‘username’=>‘admin’);
$a = $sql->select(‘users’,$trazi);

while($row = mysql_fetch_assoc($a))
{
echo $row[‘username’];
}[/php]

dobijem gresku ali prikazani kod je dobar (SELECT * FROM users WHERE id = 1 AND username = admin):

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given

FIXED; sorry 4 spam :frowning:


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja