I am wondering how to go among this,
I have this script to connect to my Database, and display the contents within the table I want from the database.
<?php
$conninfo=mysql_connect("localhost", "******", "******");
mysql_select_db("main_news",$conninfo);
$sql = "SELECT * FROM index";
$result = mysql_query($sql, $conninfo) or die(mysql_error());
while ($Get = mysql_fetch_array($result)){
$newsid = $Get['newsid'];
$title = $Get['title'];
$who = $Get['who'];
$message = $Get['message'];
$displaycount=1;
echo ("<table border=\"0\" width=\"500\">");
echo ("<tr>");
echo ("<td>");
echo ("<font face=\"Verdana\" style=\"font-size: 9pt; font-weight: 700\" color=\"#003567\">$title<br>");
echo ("</font><font face=\"Verdana\" style=\"font-size: 9pt\" color=\"#003567\">Posted by $who<br>");
echo ("</font><font face=\"Verdana\" color=\"#003567\" style=\"font-size: 8pt\">$message</font></td>");
echo ("</table>");
echo ("<br>");
echo ("<br>");
$displaycount++;
}
?>
Not sure how to go among this, I would want to only display the latest 10 entries in the database.
Thanks in advance!