Hi,
i have made a page where users can add to my database the title,rating and review of any gae they choose. can someoone please explain how, in PHP code, i can display this info on a page suitably, without having to draw up a table in html everytime someone adds to the list of reviews.
Sort of like a guestbook i think.
Thanx in advance
IAT
Automacticly updating page
Moderator: General Moderators
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
example
i should think this is the standard way most people do it
Code: Select all
// you have the variable $array from previous SQL select
// im assuming array starts with [1] and not [0] (personal preference)
$count = count($array);
if ($count >= 1)
{
// we have a result we can auto print <table
print "<table width=\"500\">";
for ($i = 1; $i <= $count; $i++)
{
print "<tr>";
print "<td>{$array[$i][item]}</td>";
print "</tr>";
}
// close after the loop
print "</table>";
}