Printing database output in tabular form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ronrsr

    Printing database output in tabular form

    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-

  • Fredrik Lundh

    #2
    Re: Printing database output in tabular form

    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>

    Comment

    • ronrsr

      #3
      Re: Printing database output in tabular form



      On Nov 13, 2:48 pm, Fredrik Lundh <fred...@python ware.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',array s 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-

      Comment

      • Marc 'BlackJack' Rintsch

        #4
        Re: Printing database output in tabular form

        In <1163446803.990 020.112810@i42g 2000cwa.googleg roups.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

        Comment

        • Gabriel Genellina

          #5
          Re: Printing database output in tabular form

          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

          Comment

          • ronrsr

            #6
            Re: Printing database output in tabular form

            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-

            Comment

            Working...