Forum Moderators: open
Could someone please help me with a thing...
As I needed a CMS that wasnt quite regular, I had to make one of my own, so I did, but now I have all sorts of things, that I am just not qualified enough to think of myself, so now I need a small number, that would show how many comments does a story have.
Down here , you see the query, that outputs the start of a story, for my news scroller.
$result = mysql_query("SELECT * FROM cms ORDER BY id desc limit 5");
echo "<table width=\"200\" align=\"center\">";
while($row = mysql_fetch_array($result))
{
$row['title'] = substr($row['title'], 0, 60);
$row['content'] = substr($row['content'], 0, 60);
echo "<tr>";
echo "<td><font class=\"text\"><a href=\"http://mysite.com/index.php?id=".$row['id']."\">".$row['title'] . "</a></font><br><font class=\"text1\"><a href=\"http://mysite.com/index.php?id=".$row['id']."\">" . $row['content'] . "...</a><br><font class=\"text7\"><sup>" . $row['time'] . "</sup></font><br></td>";
echo "</tr>"; $query1 = "SELECT * FROM comments where added like '$id1' ORDER BY id asc";
$result1 = mysql_query($query1) or die('Error : ' . mysql_error());
while($row1 = mysql_fetch_array($result1))
echo "<tr><td width=\"100%\" align=\"left\" colspan=\"2\"><br><img src=\"images/langmanager.png\" width=\"1.5%\"><font class=\"text1\">Commented by ".$row1['person'] . "<Br><img src=\"images/month_f2.png\" width=\"1.5%\">".$row1['time'] . "</font><br>" . $row1['text'] . "<br><br>";
echo "</td></tr>";
and the link that i use to get my story is mysite.com/index.php?id1=(the id that the story uses)
Can anyone help me?