Re: Speed test: mysql query vs. file_exists()
| From: | Mike Eheler | Date: | Fri, 25 Jan 2002 00:11:57 +0000 |
| Subject: | Re: Speed test: mysql query vs. file_exists() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-82013@lists.php.net to get a copy of this message | ||
That would probably give you more control over the data.. however is not really an ideal solution. Also, if you want speed.. go with the file method.
That's how I'd do it, anyhow.
Mike
Qartis wrote:
I'm running a logs system where log entries are .log files with filenames like 03012002.log for January 3rd, 2002. You can view when logs have been posted with a calendar, which will make the particular day a link if that day's log file exists. I'm thinking of storing the log entries in a mysql database, using code somewhat like the following: $query = "select username, log, date_format(date, '%a %b %D') as date, from-- Today when a man gets married he gets a home, a housekeeper, a cook, a cheering squad and another paycheck. When a woman marries, she gets a boarder.logs where username = $username";$dates = mysql_db_query($bb_news_db, $query) or die("Select Failed!"); while ($row = mysql_fetch_array($dates)) { $date[row[$dates]]=1; } So that each log entry would be put in the $date[] array, and then when the calendar script wanted to find out if there was an entry by that user on that particular day, it would just have to check the $date[] array.Will there be any speed difference between this and my current (file_exists();) method?