I have read the parts of the manual(s) but am just not grasping something...

I have 2 tables, one holds the Property ID etc., and the other holds all the
Property Details. They are connected by a field called 'PropertyID' which is
a unique ID that appears in both records.

I want to count the number of records in PropertyDetails that have an entry
in a field called 'Image1Desc', but I need to do this based on a previously
chosen field from Property called 'PropertyType'. However, the code below is
simply not giving the results I need:

$phselect = "select COUNT(*) AS phTotal from properties LEFT JOIN
propertydetails ON properties.PropertyID=propertydetails.PropertyID where
((propertydetails.Image1Desc='') AND
(properties.PropertyType='$PropertyType'))";

$phresult = mysql_query ($phselect,$conID);
        while ($phrow = mysql_fetch_array($phresult)) {
        $phTotal = $phrow["phTotal"];
        PRINT "<td align=\"right\">$phresult</td>\n";
        } // end WHILE

Is there an obvious problem here and can anyone help?

Martin E. Koss
M: 07946-706459
E: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to