Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 2nd, 2006, 07:55 PM
flit
Guest
 
Posts: n/a
Default Simple HTML display of a select query

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

  #2  
Old August 2nd, 2006, 10:55 PM
Larry Bates
Guest
 
Posts: n/a
Default Re: Simple HTML display of a select query

flit wrote:
Quote:
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
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles