I'm creating a simple e-mail web-based client which simulates the folder feature of IMAP. What I have done is to save the whole e-mail along with some important mail headers like subject, from, to, date.
My schema is:
mail_uid varchar(x) primary
mail_subject -do-
mail_from -do-
mail_date timestamp
mail_source blob
viewed char(1)
folder char(25)
now, when i add some folder manipulations like moving a certain email to a folder all i did was to update the record using mail_uid as its key and specifying a new value for the folder field. All is working fine, except that after the update statement the value of mail_source (which was previously it contains newlines similar the to raw data from the pop server) now contains a single long line of string... WHAT happened was that all new lines was removed by the update statement... I have done some solution in order to preserve the new line, what I did was to select all the data of the record specified by mail_uid
and then delete that record using the mail_uid and re-insert the selected data to the table with its folder field changed to the desired value.
I hope that someone could give me a better solution to my problem .. Hope someone could give me a single line of sql code to further speed up the processing unlike my solution.
Please give me your comments, suggestions or solutions to my problem. "I NEED TO PRESERVE EVERY NEW LINE IN MY MAIL_SOURCE"
Hoping for your response..
THANKS!! and more power to all
Juney
My schema is:
mail_uid varchar(x) primary
mail_subject -do-
mail_from -do-
mail_date timestamp
mail_source blob
viewed char(1)
folder char(25)
now, when i add some folder manipulations like moving a certain email to a folder all i did was to update the record using mail_uid as its key and specifying a new value for the folder field. All is working fine, except that after the update statement the value of mail_source (which was previously it contains newlines similar the to raw data from the pop server) now contains a single long line of string... WHAT happened was that all new lines was removed by the update statement... I have done some solution in order to preserve the new line, what I did was to select all the data of the record specified by mail_uid
and then delete that record using the mail_uid and re-insert the selected data to the table with its folder field changed to the desired value.
I hope that someone could give me a better solution to my problem .. Hope someone could give me a single line of sql code to further speed up the processing unlike my solution.
Please give me your comments, suggestions or solutions to my problem. "I NEED TO PRESERVE EVERY NEW LINE IN MY MAIL_SOURCE"
Hoping for your response..
THANKS!! and more power to all
Juney