I am trying to grasp the topic of joining tables in SQL. I know there are multiple joins but not sure which to implement here:
Here is my SQL line in php:
$sql=mysql_query("
SELECT * FROM comments
WHERE item_id = '{$item_id}'
AND review > ''
ORDER BY good DESC, rate_id ASC");
This is what I want to join with: Another table called "users". *"users" and "comments" both have a column called "user_id" to join.* I want to associate those two to find the full "username" in the users table.
I know SELECT is not best practice; but for the sake of this demo, can you include that here? I also know MySQL injection possibilities to watch for. **