Skip site navigation (1) Skip section navigation (2)

Re: Carriage Returns Disappearing

From: <operationsengineer1(at)yahoo(dot)com>
To: operationsengineer1(at)yahoo(dot)com,Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Carriage Returns Disappearing
Date: 2005-05-31 18:32:29
Message-ID: 20050531183229.54001.qmail@web52401.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
it isn't a sessions issue...  i tested my code to the
same page and received the same single space for any
number of carriage returns in my varchar field.

--- operationsengineer1(at)yahoo(dot)com wrote:
> 
> --- Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com> wrote:
> > Hi,
> > 
> > On 5/26/05, operationsengineer1(at)yahoo(dot)com
> > <operationsengineer1(at)yahoo(dot)com> wrote:
> > > my users enter a note.  i would like to keep
> > carriage
> > > returns intact.  however, when i display the
> data,
> > the
> > > two carriage returns are lost and replaced with
> > two
> > > spaces.
> > > 
> > > i use adodb's qstr() fumction to handle my
> > excaping
> > > upon entry.
> > 
> > There seems to be a problem with ADOdb's escaping
> > PostgreSQL literals
> > routine, because it's commented out and ADOdb is
> > using its default
> > qstr() routine. (I should check it in an suitable
> > time.) Therefore, I
> > advice you to use pg_escape_string().
> > 
> > Regards.
> > 
> > P.S. I've traced to qstr() code but couldn't find
> > the
> > adodb_str_replace() function in ADOdb source code
> > used by qstr().
> > Thus, I cannot give a correct answer about where
> > qstr() dumps your
> > problem.
> > 
> 
> i used pg_escape_string() and received the same
> results.  the carriage returns are showing up as
> stored in the db.  when select the data, though, the
> carriage returns are replaced with a single space,
> regardless if it is one return or 5 returns.
> 
> the sql seems to be pretty standard fare...
> 
> $sql_notes = "SELECT notes.assembly_notes 
> FROM t_product prod, t_link_product_assembly_notes
> link, t_assembly_notes notes
> WHERE link.product_id = prod.product_id
> AND link.assembly_notes_id = notes.assembly_notes_id
> AND link.product_id = " . $product_id;
> 
> i then send the array of values to another page
> where
> this code displays the array...
> 
> $i=1;
> foreach ($_SESSION['row_notes'] as $row)
> {
> print $i.". ".$row['assembly_notes']."<hr />";
> $i++;
> }
> 
> does anyone know why my carriage returns are not
> displaying when i call the data?
> 
> is it because i send the array to another page via
> the
> session variable?
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

pgsql-novice by date

Next:From: John DeSoiDate: 2005-05-31 18:45:15
Subject: Re: Functions
Previous:From: operationsengineer1Date: 2005-05-31 17:55:12
Subject: Re: Carriage Returns Disappearing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group