Never came across this before…
SELECT ".TBL_USERS.".username,
".TBL_USERS.".id, <-----------|
".TBL_COMMENTS.".creator, |
".TBL_COMMENTS.".comment, |- same column name
".TBL_COMMENTS.".date, |
".TBL_COMMENTS.".id <---------|
As you can see, I am selecting two id columns… When i take them in PHP:
$userid = $row['id'];
How will I be able to realize which one is which?
You need to use a column alias, with
ASkeyword:Example:
Now from your query result, you can get them like this:
More Info:
http://dev.mysql.com/doc/refman/5.0/en/select.html