Baqa Posted April 17, 2013 Share Posted April 17, 2013 Hi every one, I am in chapter 11 page 360 step 11 backing up database. Every things works perfect. The only problem I have is new line after wrtting each record to text file. gzwrite ($fp, "\n"); This line of code is supposed to create a new line after each record but it does not. It mix up all the records. Many thanks for your help Link to comment Share on other sites More sharing options...
HartleySan Posted April 17, 2013 Share Posted April 17, 2013 Hello, and welcome to the forums. Most likely your problem is being caused because your text editor recognizes newlines as either "\r" or "\r\n", not "\n". As such, you need to either change the newline you're using in your PHP code, or (the easier solution) is that you need to change the settings in your text editor to view "\n" as a newline. Link to comment Share on other sites More sharing options...
Baqa Posted April 18, 2013 Author Share Posted April 18, 2013 Many thanks HartleySan Your right I changed it from '\n' to '\r\n' now it is ok. The lines are breaking well. Link to comment Share on other sites More sharing options...
HartleySan Posted April 18, 2013 Share Posted April 18, 2013 Excellent. Link to comment Share on other sites More sharing options...
Recommended Posts