Zepo. Posted June 27, 2007 Share Posted June 27, 2007 I want all of the news articles to be displayed, but it only displays one. <?php /*Start the sesion*/ session_start(); /*Lets pull the data from the database*/ $result = mysql_query("SELECT * FROM news"); $news = mysql_fetch_array($result); /*Check the sessions permissions*/ if (isset($_SESSION['name'])) { if ($_SESSION['rights'] == 100){ if ($act == "editnews") { echo "<div class='pagetitle'>News Manager</div> <div style='margin:10px'> <br /> <table cellpadding='4' cellspacing='0' border='0' align='center' width='95%' class='tborder' id='optionsform' > <colgroup span='2'> <col style='width:45%'></col> <col style='width:55%'></col> </colgroup> <tr> <td class='tcat' align='center' colspan='2'> <b>Edit News</b> </td> </tr>"; /*THIS PART NEEDS TO REPEAT*/ echo " <tr valign='top'> <td class='optiontitle' colspan='2'><div>$news[title]</div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' ><center>$news[news] </center></div></td> </tr>"; echo " </tbody> </table>"; if($act == "edit") { } if($act == "delete") { } if (isset($_POST['submit'])) { editnews(); } } } } ?> How can i get it to list everything? Link to comment https://forums.phpfreaks.com/topic/57347-solved-how-do-you-list/ Share on other sites More sharing options...
teng84 Posted June 27, 2007 Share Posted June 27, 2007 perform a loop while($news = mysql_fetch_array($result)) { put the echoing here } Link to comment https://forums.phpfreaks.com/topic/57347-solved-how-do-you-list/#findComment-283554 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.