weird sql issue passing row from one sql query to another
Hi all,
I have a weird issue, which I don't think happened the last time I did this on an old machine a few years ago.
I am trying to load unique landlords into a table and within that table results of all of their real estate properties
But what is happening is that it will only look at the first record.
This is the SQL for loading the landlord
mysql_select_db($database_db, $db);
$query_loadproperties = sprintf("SELECT Distinct *
FROM landlord
LEFT JOIN property ON property.landlord_id = landlord.landlord_id
GROUP BY landlord.landlord_id
ORDER BY landlord.landlord_id ASC", GetSQLValueString($colname_loadproperties, "text"));And this is the property loading
$query_loadtenant = sprintf("SELECT *
FROM property
LEFT JOIN landlord ON property.landlord_id = landlord.landlord_id
WHERE landlord.landlord_id = '".$row_loadproperties['landlord_id']."'
ORDER BY landlord.landlord_id ASC", GetSQLValueString($colname_loadtenant, "int"));I've tried out a few things but the nearest I can get is to load one property to each landlord.
Any help or suggestions would be appricated
