Q:

How To Join two table username and msg table

How To Join two table username and msg table
table one: users.
                        |user_id |  username|
                        |-------------------|  
                        |1       |     joe  |
                        |2       |     james|    
                        |3       |     john |
                        --------------------

table two::- msg
                        ---------------------
                        |user_id|  msg      |
                        |------ |  -------- |
                        |2      |   hey     |
                        |3      |   hi      |
                        |1      |  sups guys| 
                        |2      |   am good |
                        --------------------- 

i want result like this:
                        --------------------
                        |username| msg      |
                        --------|-----------|
                        |james   |hey       |
                        |john    | hi       |  
                        |joe     | sups guys|
                        |james   | am good  |

finally how can i echo it out from database using php on a web browser
thanks 

A:

I think that something like just this :
SELECT u.username, m.msg
FROM users u
INNER JOIN msg m ON m.user_id = u.user_id

should be ok

