Look in the mysql manual on joins. http://www.mysql.com/doc/J/O/JOIN.html
There is also some articles on this subject at http://www.onlamp.com/onlamp/general/mysql.csp Mike ----- Original Message ----- From: "Alex Behrens" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 27, 2002 7:00 PM Subject: SELECT frmo two tables > Hey All, > > I am having problems working on a script and need some advise. Here's my > problem. I have two tables with teh following variables: > > rahs table: > name, number, team, position > > stats table: > name, team, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date > > and I need to make it so using a pulldown menu I can select player stats by > their position but since the position variable isnt in both tables is it > possbile to do a select command using a variable from one table for another > table? > > Here's my syntax, but i dont know if it works: > > $groundballsquery = mysql_query("SELECT SUM(groundballs) AS grouders FROM > stats WHERE (position = '$position') FROM rahs"); > > is it possible to do a WHERE command with a FROM command? > > Thanks! > -------------------------------------------- > -Alex "Big Al" Behrens > E-mail: [EMAIL PROTECTED] > Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) > Phone: 651-482-8779 > Cell: 651-329-4187 > Fax: 651-482-1391 > ICQ: 3969599 > Owner of the 3D-Unlimited Network: > http://www.3d-unlimited.com > Send News: > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php