Hello,
The code below returns the 10 most recent entries to a MySQL database. That's what I want, but I also want it to display the results in an HTML table. Right now, only the most recent result is in a table, a one-row table. The rest of the results are displayed in a jumble of text. How could I get all of the results in a 10-row table?
Thanks in advance,
John
$sqlStr = "SELECT loginid, title, url, displayurl
FROM submission ORDER BY datesubmitted DESC LIMIT 10";
$result = mysql_query($sqlStr);
$arr = array();
echo "<table class=\"samplesrec\">";
while ($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td class="sitename2"><a href="http://www.'.$row["url"].'">'.$row["title"].'</a></td>';
echo '<td class="sitename2"><a href="http://www.'.$row["url"].'">'.$row["loginid"].'</a></td>';
echo '</tr>';
echo "</table>";