RE: [PHP-DB] What is wrong with this query?
| From: | Bastien Koert | Date: | Sun, 23 Jan 2005 05:04:22 +0000 |
| Subject: | RE: [PHP-DB] What is wrong with this query? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38269@lists.php.net to get a copy of this message | ||
What exactly are you trying to do? If you require data from each table and that data is linked somehow thur some common field (not required to be the same field across all three tables) you need to include that
SELECT a.*, b.*,c.* FROM MLS a, Cond b, Comm c where [join crtieria] and [search crtieria] ORDER BY Price DESC LIMIT 0, 50
need more info about structure and goal
bastien
From: "Chris Payne" <cjp@planetoxygene.com> To: <php-db@lists.php.net> Subject: [PHP-DB] What is wrong with this query? Date: Sat, 22 Jan 2005 23:44:29 -0500 Hi there everyone, Im trying to select data from 3 tables, Im using the following code: SELECT * FROM MLS, Cond, Comm ORDER BY Price DESC LIMIT 0, 50 But its not working, I thought this is how it worked but I guess Im wrong. Its just a basic query, but needs to pull all the info from all 3 tables in the same DB, what am I doing wrong? It works perfectly if I just use 1 table. Chris -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.2 - Release Date: 1/21/2005