mapleleaf Posted December 9, 2008 Share Posted December 9, 2008 I have two tables which have a column for email. The emails are not the same. <?php $mailquery = "SELECT subscribers.name, subscribers.email, business_contact.first_name, business_contact.last_name, business_contact.email FROM subscribers, business_contact WHERE subscribers.primary_id = '8' AND business_contact.id = '8'"; $mailresult = mysql_query($mailquery) or die(mysql_error()); $mailrow = mysql_fetch_array($mailresult); ?> I also follow this with a while doing the same. The first time round I only want the businees email and in the while i want all the subscribers email. Business email is always only one. Subscribers could be many. $mailrow['subscribers.email'] doesn't seem to work so how to differentiate? TX Quote Link to comment Share on other sites More sharing options...
mapleleaf Posted December 9, 2008 Author Share Posted December 9, 2008 use alias "SELECT subscribers.email as SB_Email" to differentiate. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.