Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    110

    Unanswered: Retrieving data from a text column

    i have created the following table:

    CREATE table test
    (
    col10 int,
    Words text);

    Nothing fancy now i inserted the table through an textarea in PHP.

    in the text area i typed something like this:
    ....

    asdfasdf
    asdf

    asdfasd
    asdfasdf

    ...

    Now the database stores the textare exactly as it was typed in.
    So far so good, except when i retrieve the data with pg_fetch_array the data is displayed like this:

    asdfassdsaasdfasdfasdfasdf

    No returns are recognized.
    Been looking all day long how i can retrieve the data exactly as it has been "put" in but with no succes.

    Can someone point me into the right direction?

    Cheers,

    -Ed

  2. #2
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Thumbs up Line Breaks !

    You should employ your own text delimitation, while inserted it's like if it wre trimmed you should insert it in the base with some line breaks (<br>) that PHP could reconginge with Htmlstripslashes .... Ok ?
    Open up
    Take a look to my Blog http://www.rundom.com/karim2k

  3. #3
    Join Date
    Mar 2004
    Posts
    110
    That could be done indeed if it wasnt for the fact that its meant for a user base that knows how to type..and that will be it.

    Its like posting a message in this forum. I can post and i reckon my "post" is stored in a db, wich in turn saves "the way" i inputted my text.

    Thats what i want too

    -Ed

  4. #4
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Thumbs up Pre-Insert

    I was just inviting you to reformat the send text beofre inserting anything in the DB, in the ordinary cases when deling with texts you must store with some stuff that would come back with all the gadgets inside.
    Open up
    Take a look to my Blog http://www.rundom.com/karim2k

  5. #5
    Join Date
    Mar 2004
    Posts
    110
    Ah ok, i didnt get it then.

    So i should have php convert the textarea right?

    -Ed

  6. #6
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Thumbs up Yep

    That would be usefull when inserting into the DB and the reverse process !
    Open up
    Take a look to my Blog http://www.rundom.com/karim2k

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •