RE: Last visitors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx) 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux