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

Printing database output in tabular form

P: n/a
when I try to print a web table containing output from a database, I am
getting more info than I want- -

I would like this to print w'o the array('c', AND I'd like the
control characters to print as HTML control chars.

array('c', '- "In the boom years of 1990-1997 developing countries paid
more in debt service than they received in new assistance."
\\r\\n\\r\\n- "Africa pays out $13.5 billion in debt service every
year." \\r\\n\\r\\n- "Africa spends four times as much on debt
repayment a')
Thanks very much for your assistance.

bests,

-rsr-

Nov 13 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
ronrsr wrote:
when I try to print a web table containing output from a database, I am
getting more info than I want- -

I would like this to print w'o the array('c',
arrays instead of strings? what database is this, and how is that
column defined ?

</F>

Nov 13 '06 #2

P: n/a


On Nov 13, 2:48 pm, Fredrik Lundh <fred...@pythonware.comwrote:
ronrsr wrote:
when I try to print a web table containing output from a database, I am
getting more info than I want- -
I would like this to print w'o the array('c',arrays instead of strings? what database is this, and how is that
column defined ?

</F>

It is a MySQL database - those columns are defined as BLOBs

bests,

-rsr-

Nov 13 '06 #3

P: n/a
In <11**********************@i42g2000cwa.googlegroups .com>, ronrsr wrote:
when I try to print a web table containing output from a database, I am
getting more info than I want- -

I would like this to print w'o the array('c', AND I'd like the
control characters to print as HTML control chars.
Look up the `tostring()` method on `array.array` objects and
`str.replace()` for replacing the line ends by '<br />'.

Ciao,
Marc 'BlackJack' Rintsch
Nov 13 '06 #4

P: n/a
At Monday 13/11/2006 16:40, ronrsr wrote:
>when I try to print a web table containing output from a database, I am
getting more info than I want- -

I would like this to print w'o the array('c', AND I'd like the
control characters to print as HTML control chars.

array('c', '- "In the boom years of 1990-1997 developing countries paid
more in debt service than they received in new assistance."
\\r\\n\\r\\n- "Africa pays out $13.5 billion in debt service every
year." \\r\\n\\r\\n- "Africa spends four times as much on debt
repayment a')
You get an *array* object from the database...? Which database? Is it
stored as a BLOB field or similar?
You could transform it to string using the tostring method, and
decode it to unicode.
--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ˇgratis!
ˇAbrí tu cuenta ya! - http://correo.yahoo.com.ar
Nov 13 '06 #5

P: n/a
I just changed the database to be a TEXT field, and that took care of
the array() stuff - Now, I'm trying to convert the formatting codes to
html.

thanks for your help.

bests,

r0sr-

Nov 13 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.