PHP SQL JOIN NOT WORKING
Posted: Mon Jan 14, 2013 7:08 am
i have done this multiple times but i must of missed something and cant get it to work
i have a PHP Database with tables
1. LettingsTenApp
2. LFeProp
both have a colomn
propID
i am trying to join them based on username (which is the user email address)
if i delete the join LettingsTenApp.propID = LFeProp.propID and just have the tenEmail = %s then the filter works.
can anyone see where i am going wrong?
thanks
i have a PHP Database with tables
1. LettingsTenApp
2. LFeProp
both have a colomn
propID
i am trying to join them based on username (which is the user email address)
Code: Select all
$colname_rsTenant = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsTenant = $_SESSION['MM_Username'];
}
mysql_select_db($database_Letting, $Letting);
$query_rsTenant = sprintf("SELECT * FROM LettingsTenApp, LFeProp WHERE tenEmail = %s AND LettingsTenApp.propID = LFeProp.propID", GetSQLValueString($colname_rsTenant, "text"));
$rsTenant = mysql_query($query_rsTenant, $hostLetting) or die(mysql_error());
$row_rsTenant = mysql_fetch_assoc($rsTenant);
$totalRows_rsTenant = mysql_num_rows($rsTenant);
if i delete the join LettingsTenApp.propID = LFeProp.propID and just have the tenEmail = %s then the filter works.
can anyone see where i am going wrong?
thanks