Simple HTML display of a select query

F

flit

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..
 
L

Larry Bates

flit said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top