Jump to content

w0rdawg

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

w0rdawg's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--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]
  2. 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]
  3. I don't know what I am doing wrong, but I'm get a "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/place/public_html/view_shout.php on line 9" Here's the code the error is coming from: [code] <?php include( "mysql_info.php" ); include( "mysql_connect.php" ); $querystring = "SELECT name, email, post FROM shoutboxtut WHERE 1 ORDER BY id DESC LIMIT 10"; $query = mysql_query( $querystring ); while( $a = mysql_fetch_array( $query, MYSQL_ASSOC ) ) {     if( !empty( $a['email'] ) ) {         $email_start = "<a href=\"mailto:".$a['email']."\" style=\"font-weight:bold;\">";         $email_end = "</a>";     } else {         $email_start = "";         $email_end = "";     };          print "Posted by ".$email_start.$a['name'].$email_end.":<br>";     print stripslashes( $a['post'] )."<BR><HR>"; }; // table create code: /* CREATE TABLE `shoutboxtut` ( `id` INT( 10 ) NOT NULL AUTO_INCREMENT , `ipa` VARCHAR( 15 ) NOT NULL , `name` VARCHAR( 255 ) NOT NULL , `email` VARCHAR( 255 ) , `post` TEXT NOT NULL , PRIMARY KEY ( `id` ) ); */ ?>[/code] Can anyone help? Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.