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
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']} ----- 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> </p>\n"; |
