On Nov 6, 10:39*pm, Scott <scle...@sgaming.orgwrote:
Hi,
* * * Which is faster writing to a file using fwrite or is using a
database to store data? *I want to create a log file and it does not
matter if it is in a text file or on a database. *I just want the one
that is easier on the server. *Any advice is greatly appreciated.
--
Your friend,
Scotthttp://sgaming.org
Sent to you from a Linux computer using Kubuntu Version 8.10
----== Posted via Pronews.Com - Unlimited-Unrestricted-Secure Usenet News==----http://www.pronews.comThe #1 Newsgroup Service in the World! >100,000 Newsgroups
---= - Total Privacy via Encryption =---
If you already have a connection open to a MySQL database then logging
data to a log table probably has minimal overhead compared to opening
a separate file, obtaining a lock, writing your log line, releasing
the lock and closing the file. If you were connecting to the database
with the sole intention of logging something then the file would be
the better choice. However, the overhead of either approach shouldn't
be enough to be noticeable to an end user.
So my choice would be: Do you need to connect to a database anyway?
YES: Use a DB table
NO: Use a file