Printing database output in tabular form

R

ronrsr

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

Fredrik Lundh

ronrsr said:
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>
 
M

Marc 'BlackJack' Rintsch

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
 
G

Gabriel Genellina

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
 
R

ronrsr

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-
 

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
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top