Jump to content

Archived

This topic is now archived and is closed to further replies.

CanMan2004

query 2 tables

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.