You are here: RE: [PHP] Last visitors « PHP « IT news, forums, messages
RE: [PHP] Last visitors

Posted by Tom Crimmins on 04/20/05 16:35

On Tuesday, April 19, 2005 18:46, Ryan A wrote:

> 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

You can leave these off. Changing ENGINE to TYPE will fix that error, and
you can leave off the charset. I believe utf8 was added in 4.1. If you
leave off charset=xxx it will just default to whatever the server's
default-character-set is set to, probably latin1.

> 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

--
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация