What’s more efficient – storing logs in sql database or files?

Logs using files are more efficient, however logs stored in the database are easier to read, even remotely (you can write a web frontend if required, for example). Note however that connecting and inserting rows into the database is error prone (database server down, password wrong, out-of-resources) so where would you log those errors if … Read more

Writing a new line to file in PHP (line feed)

Replace ‘\n’ with “\n”. The escape sequence is not recognized when you use ‘. See the manual. For the question of how to write line endings, see the note here. Basically, different operating systems have different conventions for line endings. Windows uses “\r\n”, unix based operating systems use “\n”. You should stick to one convention … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)