Jump to content

Help needed with an php article listing script


K3nnnn

Recommended Posts

im making a small cms for a personal site for a project of mine. the script runs through a mysql table and echos the latest 5 article postings, well the title anyway. Its working great but i want it to also echo the 'tagline/description' aswell from the database, Ie title then description. no matter what i try it prints one or the other if its any help heres the script

[quote]<link href="my.css" rel="stylesheet" type="text/css" />

<?php include("header.php"); ?>

<b><span class="content_header_pined">Latest Articles: </span></b><br>
<?php
// Require the database class
require_once('includes/DbConnector.php');

// Create an object (instance) of the DbConnector
$connector = new DbConnector();

// Execute the query to retrieve articles
$result = $connector->query('SELECT ID,title FROM cmsarticles ORDER BY ID DESC LIMIT 0,5');


// Get an array containing the results.
// Loop for each item in that array
while ($row = $connector->fetchArray($result)){

echo '<p> <a href="viewArticle.php?id='.$row['ID'].'">';
echo $row['title'];
echo '</a> </p>';

echo '<hr />';


}
?>
<?php include("footer.php"); ?>[/quote]

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.