Create following two tables to your database
Create table `users` (
`user_id` Int NOT NULL AUTO_INCREMENT,
`user_name` Varchar(20) NOT NULL,
`password` Varchar(34) NOT NULL,
`name` Varchar(100) NOT NULL,
Primary Key (`user_id`)
) ENGINE = InnoDB;
Create table `online` (
`online_id` Int NOT NULL AUTO_INCREMENT,
`user_id` Int NOT NULL,
`user_name` Varchar(15),
`log_time` Int,
Primary Key (`online_id`),
Index `online_user_id_INX` (`user_id`),
Foreign Key (`user_id`) references `users` (`user_id`) on delete restrict on update restrict
) ENGINE = MEMORY;
Note: You should add your user/member table and correct the foreign key in online table. If you have different user id field name then replace all user_id occurence in online.class.php with your user id field name.
|