> > Btw, Vlad, I've run into issues when I tried to get the usernames > linked > to each website. Can you tell me what's wrong with the following query? > It currently only returns one row, I must be missing something: > > SELECT `site_tree`.`id` AS `site_tree_id`, `sites`.`site` AS `site`, > `sites`.`date_added` AS `date_added`, `users`.`nickname` AS `nickname` > FROM site_tree, sites, game_sessions, users > WHERE `site_tree`.`site_id` = `sites`.`id` AND `site_tree`.`session_id` > = `game_sessions`.`id` AND `game_sessions`.`user_id` = `users`.`id` [Vlad] try this one: SELECT `site_tree`.`id` AS `site_tree_id`, `sites`.`site` AS `site`,`sites`.`date_added` AS `date_added`, `users`.`nickname` AS `nickname` FROM site_tree INNER JOIN sites ON site_tree.site_id = sites.id INNER JOIN game_sessions ON site_tree.session_id = game_sessions.session_id INNER JOIN users ON game_sessions.user_id = users.id ORDER BY users.nickname
> > Also, going through the database made me wonder about one thing - why > do > you base things on the session, rather than on users? For example the > site_tree reference to the session, or the hack points and scan points > in the game_session table? I understand the issue of having anonymous > users, but wouldn't it be more handy to create anonymous users on the > fly when an anonymous session is started? [Vlad] it felt more convenient not to add anon users to the database. I would have had to change the login function and add an extra flag to not check anon users. Also, the registration would have changed, no more inserting a user, just updating the anon user and extra conditions to see which users we have to update exactly. > _______________________________________________ Hackit Bar mailing list - [email protected] Wiki: http://community.hackit.cx/ List: http://community.hackit.cx/ml/ Forum: http://community.hackit.cx/forum/ Ideas: http://community.hackit.cx/ideas/ IRC: irc://irc.freenode.net/#politis
