Hello,
The code below works nicely. Each "title" in the MySQL table "submission" is printed in reverse chronological order alongside its corresponding "loginid."
I have another MySQL table ("login") with the fields "loginid" and "username." So each row has a "loginid" and a "username." The "loginid" in these two MySQL tables "submission" and "login" are equivalent to each other.
In the HTML table printed below, how could I replace the "loginid" with the "username"?
Thanks in advance,
John
<?php
$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="sitename1"><a href="http://www.'.$row["url"].'">'.$row["title"].'</a></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="sitename2"><a href="http://www.'.$row["url"].'">'.$row["loginid"].'</a></td>';
echo '</tr>';
}
echo "</table>";
?>