unsider Posted February 26, 2008 Share Posted February 26, 2008 1. I also have a script that allows you to store comments into a database, and it then outputs those comments with date, text, etc... 2. At the moment I have an array called ( $names ) full of ("hello"). Displayed functionality: http://rhythmicdesign.com/andy/index.php I only currently have the pagination working for the array of words, I need the array to be functional with comments, so that if 32 comments are displayed it becomes 3.2 pages, you know it works. It is 2 seperate components, but I would like to combine the two and display the comments, as opposed to an array string of text. If that didn't make sense, make sure to question me Everything is fully functional, I just need to turn the comments into something I can feed into the pagination so that it becomes one, I have trouble explaining it. 1. <? echo '<table>'; $tr=1; while ($row = mysql_fetch_array($result)) { echo '<tr class="tr' . $tr . '"><td>' . $row["name"] . ' says: <br>' . $row['commentdate'] . '<br>' . $row['commenttext'] . '</td></tr>'; if($tr==1){ $tr=2; } else if($tr==2){ $tr=1; } } echo '</table>'; echo '<br>'; echo '<a href="' . $_SERVER['PHP_SELF'] . '?addcomment=1">Add comment!</a>'; ?> 2. <? $names = array("hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello","hello"); $page = $_GET['page']; $pagedResults = new Paginated($names, 10, $page); echo "<ul>"; while($row = $pagedResults->fetchPagedRow()) { echo "<li>{$row}</li>"; } echo "</ul>"; $pagedResults->setLayout(new DoubleBarLayout()); echo $pagedResults->fetchPagedNavigation(); ?> Quote Link to comment Share on other sites More sharing options...
unsider Posted February 26, 2008 Author Share Posted February 26, 2008 I know someone wants to help me I mean well, and I'll do everything I can to help you figure it out. 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.