Re: Last visitors

From: Date: Tue, 19 Apr 2005 23:46:03 +0000
Subject: Re: Last visitors
Groups: php.general 
Request: Send a blank email to php-general+get-213435@lists.php.net to get a copy of this message
Hey, Thanks for replying, I tried using the test example of Petar Nedyalkov, but when i try to create the following: CREATE TABLE profile_log ( profile_id int(10) default NULL, user_id int(10) default NULL, last_login timestamp NOT NULL ) ENGINE=MyISAM CHARSET=utf8 I get an error on both ENGINE=MyISAM and CHARSET=utf8 What are they for really? can I omit them? or will that effect the program later on? Thanks, Ryan On 4/19/2005 4:42:08 PM, Tom Crimmins (php@pottcounty.com) wrote: > On Tuesday, April 19, 2005 09:09, John Nichel wrote: > > > > > Petar Nedyalkov wrote: > > > <snip> > > >> You can store only 10 records for each user by using the following > > >> logic: > > >> > > >> mysql> show create table profile_log\G > > >> *************************** 1. row *************************** > > >> Table: profile_log Create Table: CREATE TABLE > >> profile_log ( > > >> profile_id int(10) default NULL, > > >> user_id int(10) default NULL, > > >> timestamp timestamp NOT NULL default > >> CURRENT_TIMESTAMP on update > > >> CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=utf8 > > >> 1 row in set (0.00 sec) > > >> > > >> When you create a profile you fill 10 blank records with timestamp > > >> 0000-00-00 00:00:00. > > >> > > >> Then if a user sees a profile: > > >> > > >> PSEUDO SQL: > > >> > > >> $SQL = "UPDATE profile_log SET user_id=".$userId. > " WHERE > >> profile_id=". $profileId." ORDER BY timestamp ASC LIMIT 1 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.16 - Release Date: 4/18/2005

« previous php.general (#213435) next »