Jump to content

Help with news system


Cliftron

Recommended Posts

Hey all.

I need some help. something really basic.

Im trying to build my own cms. I been coding php for about half a year.

 

Anyway my news system has one flaw. it doesn't have a limit on posts or a system to show a next page of news articles.

 

Heres the code for my news include:

<?php
$con = mysql_connect("***","***","***");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("soundworkcms", $con);

$result = mysql_query("SELECT * FROM news ORDER BY Date DESC");



while($row = mysql_fetch_array($result))
  {
echo '<div class="left_box">';
echo '<div class="left_title"><span class="textheader">';
echo $row['Title'];
echo '</span> - <span class="textauthor">';
echo $row['Author'];
echo ' ';
echo $row['Date'];
echo ' </span></div>
<div class="left_img"><img src="images/img.jpg" />
</div>
</div>
<div class="article">
  <p>';
echo $row['Article'];
echo '</p>

  </div>';
  }


mysql_close($con);
?>

 

Id love some help.

I have been stressing over this

 

Much Appreciated.

Link to comment
https://forums.phpfreaks.com/topic/175362-help-with-news-system/
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.