Re: Highlighting data selected from one table that appear in another

From: Date: Thu, 01 Sep 2005 21:47:04 +0000
Subject: Re: Highlighting data selected from one table that appear in another
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-40197@lists.php.net to get a copy of this message
I'm thinking that you need a "LEFT JOIN" (see the mysql documentation) to do this. Basically LEFT JOIN (or RIGHT JOIN) allow you to select all the rows from the table on the left side even if they have no corresponding row on the right side (the values of the columns in the select that belong to the right hand table will be NULL where there is no row to join to). But if you could be more specific - send the schema and precisely what you were looking to do I could give you an example of how to make it work. Good Luck, Frank On Sep 1, 2005, at 5:00 AM, php-db-digest-help@lists.php.net wrote:
From: boclair <boclair@bigpond.net.au> Date: September 1, 2005 4:50:05 AM PDT To: "php-db@lists.php.net" <php-db@lists.php.net> Subject: Highlighting data selected from one table that appear in another Content-Type: multipart/alternative;
    boundary="------------070700030402040702060708"
X-Authentication-Info: Submitted using SMTP AUTH PLAIN at omta05ps.mx.bigpond.com from [138.130.220.111] using ID boclair at Thu, 1 Sep 2005 11:49:59 +0000
This is a multi-part message in MIME format. --------------070700030402040702060708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit mysql 4.0.25 php 4.3.1 I seem to be unable to solve this problem without some help. A webpage is to list all the clients in a mysql " Client" table. Each client has an an allocated clid. Those clients who are listed, identified by their allocated clid, in a "Transactions" are to be highlighted in different ways according to progress of the transaction, the progress being determined on whether date values have been inserted into various fields. Since mysql select joining the tables lists only the clients whose appear in both tables. I have been attempting to create a temporary table inserting the data from "Client" and "Transactions" and selecting from that but not successfully yet. But is this the way to go about it. The scale is an anticipated 1000 clients per month of which an anticipated 800 will involve transactions Louise


« previous php.db (#40197) next »