View Single Post
Old Mar 24th, 2008, 12:58 AM   #5
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 742
Rep Power: 3 Jimbo is on a distinguished road
Re: MySQL - Basic Combining Of Queries

Not the most elegant, but perhaps fits your needs?
mysql Syntax (Toggle Plain Text)
  1. SELECT $table_ranking.*, $table_user.name
  2. FROM $table_ranking INNER JOIN $table_user ON $table_ranking.user_id=$table_user.user_id
  3. WHERE $table_user.user_id IN ($gameIds)
$gameIds should be a CSV list of user IDs put together in your PHP script somewhere (assumption: you're putting a list together in PHP, since this is in the PHP forum...)
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote