Jump to content

[SOLVED] Getting rows from different tables with the same column name


mapleleaf

Recommended Posts

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.