I’ve tryed the search buttons as i’m sure this will have been asked at one time, but i’m getting “Each word must be at least two characters long.” when searching “show data from 2 tables” with match all words on.
Here is what i’m trying to do.
2 tables within my database one is for a chat feature, the other is the user list. both have 1 fiel in common user_id
I’m trying to get it so I can output
username(post count) with the info from both tables. I can get the details from one ok, just incorporating the 2nd table to get the username is the issue.
[php]$resulta = mysql_query(“SELECT user_id, count(message_id) as post_count FROM phpbb_mchat Group By user_id ORDER BY post_count DESC LIMIT 10”);
while ($row1 = mysql_fetch_array($resulta))
{
list($user_id, $post_count) = $row1;
echo "$user_id($post_count), ";
}
$resulta = mysql_query(“SELECT phpbb_mchat.user_id, count(message_id) as post_count, username, user_colour FROM phpbb_mchat INNER JOIN phpbb_users ON phpbb_mchat.user_id=phpbb_users.user_id WHERE phpbb_mchat=‘user_id’ Group By user_id ORDER BY post_count DESC LIMIT 10”);
while ($row1 = mysql_fetch_array($resulta))
{
list($user_id, $post_count, $username, $user_colour) = $row1;
echo "$user_id($post_count), ";
}[/php]
the first one is the only output i have working. I’m searching google for help at same time, so thought I’d ask here as well.