By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,956 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,956 IT Pros & Developers. It's quick & easy.

Simple HTML display of a select query

P: n/a
Hi all,

How Can I do in the simplest way, display in html one table with the
return of 3 collums?
Like
1- consult mysql base
2- make the select query
3- show the values.

I am a kind of lost in the frameworks, and modules.
I think a lot of them with little documentation.
Just a simple display in html for this, nothing more.
No need this time for right coding, if I need to remake the program in
the future its ok..

Aug 2 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
flit wrote:
Hi all,

How Can I do in the simplest way, display in html one table with the
return of 3 collums?
Like
1- consult mysql base
2- make the select query
3- show the values.

I am a kind of lost in the frameworks, and modules.
I think a lot of them with little documentation.
Just a simple display in html for this, nothing more.
No need this time for right coding, if I need to remake the program in
the future its ok..
You don't do it much differently than you would to display them
on a regular screen or a piece of paper, except that you must wrap
the values in html table (not tested). I hope I'm understanding
your question.

print "<table>"
print "<th>Column 1</th><th>Column 2</th><th>Column 3></th>"
for row in rowsreturnedbysqlquery:
print "<tr><td>%s</td><td>%s</td><td>%s</td></tr>" % \
(row[0], row[1], row[2])

print "</table>

Now the fun comes when you wish to embellish this with font
sizes, colors, background colors, .... then the frameworks
come in really handy.

-Larry Bates
Aug 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.