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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.