FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


BBcode Problem implementing??





flatliner
Ok well I got the BBcode all setup and it does work np the only thing is I am calling my text from a MySQl database and I need all the rows fetch from the table to outputted, but only one is when I use the code below, but if I dont use the BBcode fuction they all output fine. Only the last row of data in the table is outputted when I use the code below, can any1 help me?

Note: Some of the code has been left out

Code:


// Retrieve all the data from the "$threadid" table
$result = mysql_query("SELECT * FROM {$threadid} ")
or die(mysql_error());

// Retrieve all the data from the "$threadid" table
$result2 = mysql_query("SELECT * FROM {$threadid} ")
or die(mysql_error());


$row2 = mysql_fetch_array( $result2 );
 echo "<p id=\"threadname\">{$row2['subject']}&nbsp;----- thread started by {$row2['userid']}</p>\n";





while($row = mysql_fetch_array( $result ))

$commentBB = BBcode($row[comment]);

{
   // Print out the contents of each row into a table

    echo "<tr><td width=\"100\">\n";
    echo "<img id=\"pcture\" src=\"../$row[picture]\" width=\"55\" height=\"55\" alt=\"\" border=\"0\">\n";
   echo "<strong>Name:</strong>$row[userid]<br><strong>Age:</strong>$row[age]";

   if ($row[useridnumber] == $mysession)

   { echo "<br><a href=\"editpost.php?threadid=$threadid&postid=$row[postid]\">edit post<a/>";};

   echo "</td><td width=\"600\">\n";
    echo " $commentBB";
   echo "<br><br><br>$row[sig]</td></tr>\n";}

echo "</table></div>\n";


 echo "<p id=\"menu2\">
<a class=\"menlinks\" href=\"addreplyform.php?threadid=$threadid\">Add Reply</a>&nbsp;&nbsp;&nbsp;&nbsp;

</p>\n";
mathiaus
May have something to do with having a while statement, then having a line then opening up }
Try....
Code:
while($row = mysql_fetch_array( $result )) {
    $commentBB = BBcode($row['comment']);
flatliner
Yea thats it thanks very much. Very Happy
mathiaus
No problem Very Happy
-close-
Related topics
Problem with Subdomains
Strange Fire fox problem
Logout problem (Cookie?)
How to solve this problem? Thanks
I have a problem....Mozilla Firefox
post nuke problem
anyone had this phpBB problem?
phpbb problem....
Transport yourself over the Net
Problem with my password
Pictures problem...
database problem
same problem over here...
Header("Location: PROBLEM");
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.