Thanks for your help, Sridhar.
I think your suggestion on #1 solve my problem. I didnt know the "\n" was included in the string.. blush
I will try to be more clear on #2.
I dont have 2 ID's for the document, but can't set the same ID as I dont know what ID it gets when saved in the databse.
When a user have created a document and uploaded it, I do a insert statement to a mysql table, saving info about filename, author, time and so on. When the user uploads the file, it lies in a temp directory and have the original filename, for example "mydoc.doc".
Two users can upload two documents with the same filename, so I like to move that uploaded document to my "doc area", and renaming it so the filename become for example "<userid>_DOCiD",
where DOCiD is the id it gets in the database table after the INSERT action.(id is a primary key in that table)
The problem is: How do I find out what id the document gets? Is there a return value from MySQL that says(in a way) "You added a post in this table and in the table that row got id=#"
Or do I have to search the table for the last known ID and do what you propose: ID+1.
I'd rather come up with a way where I dont have to search the table and spare the extra time an extra search does..
Hope that was clear enough ;-)