w0rdawg Posted May 7, 2006 Share Posted May 7, 2006 I'm getting "Fatal error: Call to undefined function query() in /home/place/public_html/include/code/forum/codes.php on line 4" and I'm not to sure what i'm doing wrong...again.Here's the whole code:[code]<?php //generate smilies table$smilies = query("SELECT * FROM smilies WHERE list='1' ORDER BY $n=0; while($smile = mysql_fetch_assoc($smilies)) if($n % 5 == 0 && $n != 0) { $smilelist .=<<<END </tr> <tr>END; }$smilelist .=<<<END <td> <center> <img src=/images/smilies/$smile[img]> <br>$smile[code] </center> </td>END; $n++; //while //make an array of all the mcode tags //put "x" in the val spot to create auto example $mcode = array( "[b]Text[/b]" => "x", "[i]Text[/i]" => "x", "[u]Text[/u]" => "x", "[font=times new roman]Text[/font]" => "x", "[color=red]Text[/color]" => "x", "[size=15]Text[/size]" => "x", "[center]Text[/center]" => "x", "[align=right]Text[/align]" => "x", "[quote]Quote Text[/quote]" => "x", "[img]Image Url[/img]" => "x", "[url]http://place.org[/url]" => "x", "[url=http://place.org]Place[/url]" => "x", "[user=bpb]" => "x", "[item=Star Rod]" => "x", "[item2=Star Rod]" => "x", "[set=name]value[/set]" => "Sets variable 'name' equal to 'value'", "[var=name]" => "Returns the value of variable 'name'", "[random=Text1--Text2--Text3--Text4--Text5]" => "x", "[heart]" => "x", "[br]" => "New Line", "[p]" => "New Paragraph", ); //generate mcode table foreach($mcode AS $code=>$func) { if($func == "x") { $output = subetaFilter($code); } else { $output = $func; }$mcodelist .=<<<END <tr> <td> $code </td> <td> $output </td> </tr>END; }$body =<<<END <center> <table width=95% class=sp-cells> <tr> <td colspan=5 class=sp-sub> <center><b>Smilies</b></center> </td> </tr> <tr>$smilelist </tr> </table> </center> <p> <center> <table width=95% class=sp-cells> <tr> <td colspan=2 class=sp-sub> <center><b>mCode</b></center> </td> </tr> <tr class=sp-sub> <td> <center><b>Code</b></center> </td> <td> <center><b>Output</b></center> </td> </tr>$mcodelist </table> </center>END; blankForum("Smilies/mCode List","$body","forums.php");?>[/code] Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 [code]$smilies = mysql_query("SELECT * FROM smilies WHERE list='1' ORDER BY ...... ");[/code]Now all you need is a proper query ... WHERE list='1' ORDER BY is incomplete and non-functional. Quote Link to comment Share on other sites More sharing options...
w0rdawg Posted May 7, 2006 Author Share Posted May 7, 2006 [!--quoteo(post=372149:date=May 7 2006, 07:14 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 7 2006, 07:14 PM) [snapback]372149[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]$smilies = mysql_query("SELECT * FROM smilies WHERE list='1' ORDER BY ...... ");[/code]Now all you need is a proper query ... WHERE list='1' ORDER BY is incomplete and non-functional.[/quote]Hm...a part didnt' show in my code. I'm using order by code, but it's still not working.[code]<?php //generate smilies table$smilies = query("SELECT * FROM smilies WHERE list='1' ORDER BY code"); $n=0; while($smile = mysql_fetch_assoc($smilies)) if($n % 5 == 0 && $n != 0) { $smilelist .=<<<END </tr>die(mysql_error()); <tr>END; }$smilelist .=<<<END <td> <center> <img src=/images/smilies/$smile[img]> <br>$smile[code] </center> </td>END; $n++; //while //make an array of all the mcode tags //put "x" in the val spot to create auto example $mcode = array( "[b]Text[/b]" => "x", "[i]Text[/i]" => "x", "[u]Text[/u]" => "x", "[font=times new roman]Text[/font]" => "x", "[color=red]Text[/color]" => "x", "[size=15]Text[/size]" => "x", "[center]Text[/center]" => "x", "[align=right]Text[/align]" => "x", "[quote]Quote Text[/quote]" => "x", "[img]Image Url[/img]" => "x", "[url]http://subeta.org[/url]" => "x", "[url=http://subeta.org]Subeta Pets[/url]" => "x", "[user=highrise]" => "x", "[item=Ultra Star Rod]" => "x", "[item2=Ultra Star Rod]" => "x", "[set=name]value[/set]" => "Sets variable 'name' equal to 'value'", "[var=name]" => "Returns the value of variable 'name'", "[random=Text1--Text2--Text3--Text4--Text5]" => "x", "[heart]" => "x", "[br]" => "New Line", "[p]" => "New Paragraph", ); //generate mcode table foreach($mcode AS $code=>$func) { if($func == "x") { $output = subetaFilter($code); } else { $output = $func; }$mcodelist .=<<<END <tr> <td> $code </td> <td> $output </td> </tr>END; }$body =<<<END <center> <table width=95% class=sp-cells> <tr> <td colspan=5 class=sp-sub> <center><b>Smilies (List Currently Unavailable)</b></center> </td> </tr> <tr>$smilelist </tr> </table> </center> <p> <center> <table width=95% class=sp-cells> <tr> <td colspan=2 class=sp-sub> <center><b>mCode</b></center> </td> </tr> <tr class=sp-sub> <td> <center><b>Code</b></center> </td> <td> <center><b>Output</b></center> </td> </tr>$mcodelist </table> </center>END; blankForum("Smilies/mCode List","$body","forums.php");?>[/code] Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 7, 2006 Share Posted May 7, 2006 Sorry it mightn't have been clear but try:[code]$smilies = mysql_query("SELECT * FROM smilies WHERE list='1' ORDER BY code");[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.