hi, i have this mysql schema:
comments:
-----------------------------
|id|pageid|userid|
members:
-----------------------------
|username|userid|
sometimes the userid from comments is blank, cause anon comment. how i can get the username from members if userid from comments isn't blank.
i need to get something like this:
---------------------------
|id|pageid|userid|username|
---------------------------
Edit. i want to try to be more specific.
comments:
----------------------------------
|id|pageid|userid|comment |
----------------------------------
|1 |1 |1 | hi |
----------------------------------
|2 |1 | | annon comment |
members:
-----------------------------
|username|userid |
-----------------------------
|john |1 |
thats is a example data, now i need to get something like this:
-------------------------------------------
|id|pageid|userid|comment |username|
-------------------------------------------
|1 |1 |1 | hi |john |
-------------------------------------------
|2 |1 | | annon comment | |
ps sorry for my bad english.