FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

mySQL question

 


animassacre
until now i used mySQL with very simple querys
so now i don't now how to understand this
Code:
SELECT u.*, s.*
         FROM phpbb_sessions s, phpbb_users u
         WHERE s.session_id = 'aaeb12114e4762435bad48c13a3870a9'
            AND u.user_id = s.session_user_id



u see it's from phpbb forum , pls tell me how to interpretat it.
i want to understand how to use this cross table approach .
marixworld
i understand the query but i'm not really sure if can explain it to you well. i would suggest, you visit www.w3schools.com, they tutorials on SQL operations, also, you can visit mysql.com and download the documentation of mysql for more accurate information.
animassacre
i have disadet to get some book and read it from cover to cover

but 10x anyway
Ranfaroth
In the table phpbb_sessions, there are 2 columns session_id and session_user_id : the first one contains the session ID, and the second the user ID of the user using this session.
So this request returns all information about the user using the given session ID...
clydejaw
The SQL pretty much says it all in english.
vinx_18
SELECT u.*, s.* <---- select all phpbb_users and phpbb_sessions entities
FROM phpbb_sessions s, phpbb_users u <---- phpbb_sessions alias to 's' or rename into 's' same as phpbb_users alias to 'u'
WHERE s.session_id = 'aaeb12114e4762435bad48c13a3870a9' <--- selects phpbb_users and phpbb_sessions if phpbb_sessions.session_id equals to the given string
AND u.user_id = s.session_user_id <---- selects phpbb_users and phpbb_sessions if also phpbb_users.user_id equals to phpbb_sessions.session_user_id
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.