A
Anonymous
Guest
How would I get this code to automatically show the rows in the table without having to write the '0' and '1' etc. id's. I want to have a template that automatically adds the newest id without me having to update the script with the new id.
I had something working with a script like this...
That isn't the exact code but it worked. The only problem is that it would print the id field and there was no way that I could format the text for the different columns.
Here is the code for entries.php which I'm working on...
Thanks in advance.
I had something working with a script like this...
Code:
$result = mysql_query("SELECT * FROM entries")
while ($info = mysql_num_row(blah blah blah));
foreach($info as $field);
print $field;
That isn't the exact code but it worked. The only problem is that it would print the id field and there was no way that I could format the text for the different columns.
Here is the code for entries.php which I'm working on...
Code:
<?
require("mysql_connect.php");
?>
<style type="text/css">
</style>
<body topmargin="0">
<table border="0" bordercolor="#ffffff" width="500" cellspacing="6" cellpadding="6" bgcolor="#dddddd" align="center" background="body_bg.jpg">
<tr>
<td bgcolor=#e7e7e7>
<?
$result = mysql_query("SELECT * FROM entries");
echo "<font size=4 style=\"line-height:6pt;\">";
printf(mysql_result($result,0,"title"));
echo "</font><br>    <font size=0>";
printf(mysql_result($result,0,"date"));
echo "</font></td></tr><tr><td>";
printf(mysql_result($result,0,"entry"));
echo "</td></tr><tr><td bgcolor=#e7e7e7>";
echo "<font size=0><p align=right>";
printf(mysql_result($result,0,"post"));
echo "</tr></td>";
echo "<tr><td bgcolor=#e7e7e7>";
echo "<font size=4 style=\"line-height:6pt;\">";
printf(mysql_result($result,1,"title"));
echo "</font><br>    <font size=0>";
printf(mysql_result($result,1,"date"));
echo "</font></td></tr><tr><td>";
printf(mysql_result($result,1,"entry"));
echo "</td></tr><tr><td bgcolor=#e7e7e7>";
echo "<font size=0><p align=right>";
printf(mysql_result($result,1,"post"));
echo "</tr></td><tr><td><br>";
?>
</tr></td></table>
Thanks in advance.