biggiebi 0 Report post Posted October 21, 2007 (edited) I suck at explaining.So here I can get data from the MySQL database and I can print the info.But like how do I make it so it show a new <tr> <td class="topic"><?php echo $title ?></td> </tr> <tr> <td class="contenttext"> <?php while ( $data = mysql_fetch_array($result) ) { echo bb2html($data['message']) . '<br />';} ?> </td> </tr>everytime there's a new content?cause when i echo bb2html($data['message'])it shows all of flexbb_threads in 1<tr><td></td></tr> So like when i doecho bb2html($data['message'])I want it show<tr><td>Title1</td><td>Content1</td></tr><tr><td>Title2</td><td>Content2</td></tr> Edited October 21, 2007 by biggiebi (see edit history) Share this post Link to post Share on other sites
wutske 0 Report post Posted October 21, 2007 You have to place the <td> and all the other tags inside the loop.Like: <tr> <td class="topic"><?php echo $title ?></td></tr><tr><?php while ( $data = mysql_fetch_array($result) ) {?> <td class="contenttext"><?php echo bb2html($data['message']) . '<br />';?></td>} ?></tr> But this way, you'll only have one title (and I suppose you want a title per 'message', not ? ). Best way it to do a sqlquery where you select title and message and store it in a variable. This way, you could make something like this (supposing you store the data from the query in $sql).<?phpwhile ($tmp = mysql_fetch_object($sql) {?><tr><td><?php echo $tmp->title; ?></td></tr><tr><td><?php echo $tmp->message; ?></td></tr>}?> Share this post Link to post Share on other sites
biggiebi 0 Report post Posted October 21, 2007 nvm i got it to work...now do i make it so like every 5 news there's a new pageand it shows the next 5 news. Share this post Link to post Share on other sites
TavoxPeru 0 Report post Posted October 22, 2007 nvm i got it to work...now do i make it so like every 5 news there's a new pageand it shows the next 5 news.You need to modify your sql query to get 5 records at a time, like this:<?php$limit=5;$start=0;$sql = "SELECT col1, col2 FROM table LIMIT " . $start . ", " . $limit;$rs = mysql_query($sql) or die(mysql_error());After that loop your records as usual, and then remember to increase the $start variable by adding the value of the $limit variable.Best regards, Share this post Link to post Share on other sites