Jinah Adam ’s Official weBlog..
my thoughts, my projects, my intrests, my reviews, my life ….

carriage return, php and oracle .. and almost forgot .. line feeds

after five days of patiance, i finally did it. my first php/oracle app, everything went pretty smooth up until the final insert statement. When i inserted data to the table only some of the fields were updated. the data was comming from 4 multiline text boxes, the data was split into many fields(to suite the database design) by return key(chr(13)). and i built the query from this. when i run it throught the webserver it doesnt fill all the fields. but when i print the query on the screen , copy and paste to Hora. it inserts perfectly .

for several days i tried to solve the problem, i just couldnt found any fault with the code or the database server . anyways yesterday i was goin thru ‘ the php.net site .. and there was this forum topic. about the difference between line feeds and carriage returns…. i forgot the simplest of things.(line feeds..) hehe

i did a string replace for line feeds(chr(10)) on the query string and it worked. Even though i have written several queries i havent done any real development on oracle.. all my previous projects were in mysql and ms sql server 2000. so it was a great experiace.

6 Responses to “carriage return, php and oracle .. and almost forgot .. line feeds”

  1. speak in english please.. :P

  2. Are you sure about that? Sounds wrong to me.

  3. wrong about wat? it did work for me though..

  4. ‘mrskin’ is apparently a Microsoft sponge. Replacing the newline character still allows you to split the text into multiple lines (you have to split on ‘\r’ instead of “\r\n”) and allows a flat file parser to treat the newline character (‘\n’ or chr(10)) as a record separator. Microsoft is the only company that decided to use both a carriage return and a newline character to separate lines of text. Macs use only a carriage return, most other real operating systems use a new line character. Windows is the only oddball that uses both characters. Good job. As for the “speak in english please” comment, it might help your point if you used proper capitalization and punctuation. Besides, this IS his blog, right?

  5. Thanks Jinah Adam.

    Also thank you… GLH for explaining in detail.

    It worked!

  6. 78dvxv hmqmnpmfllmw, [url=http://zfbztvwlptwm.com/]zfbztvwlptwm[/url], [link=http://phehoedzraqm.com/]phehoedzraqm[/link], http://wmrtdkokkefw.com/


Leave a Reply