XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
Parody
Forum Contributor
Posts: 252 Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain
Post
by Parody » Tue May 24, 2005 3:43 pm
Ok, here is my problem, I have some infomation in a MYSQL database which I need to display in a HTML table. The only problem is, the amount of data can change, so I can't have a fixed table.
So here is the question:
How do I do it?
I didn't know where to put this topic so I just plonked it in Miscellaneous
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Tue May 24, 2005 3:53 pm
It's quite easy actually:
Code: Select all
$result = mysql_query($query)
echo "e;<table>"e;;
while($row = mysql_fetch_assoc($result))
{
echo "e;<tr><td>$rowїcolumn1]</td><td>$rowїcolumn2]</td>........</tr>"e;;
}
echo "e;</table>"e;;
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Parody
Forum Contributor
Posts: 252 Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain
Post
by Parody » Tue May 24, 2005 3:58 pm