Jump to content


Photo

query 2 tables


  • Please log in to reply
1 reply to this topic

#1 CanMan2004

CanMan2004
  • Members
  • PipPipPip
  • Advanced Member
  • 254 posts

Posted 05 June 2006 - 05:30 AM

Hi all

I have a query which im trying to get to search two tables rather than one, the code ive used is

sql = "SELECT * FROM friends,customers ORDER BY RAND() LIMIT 34";

but for somereason it is only searching the "customers" table and is ignoring the "friends" table, what am I doing wrong?

Thanks in advance

Dave

#2 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 05 June 2006 - 06:39 AM

This query will join the tables, not search the results in both and list them one below another....If you need records from both the tables, use 2 seperate queries...
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users