Jump to content

[SOLVED] How do you list?


Zepo.

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.