title: Php query regarding 2 FK and 1 Primary Key
body: <p>In my table internships, I have two foreign keys <strong>id_promoter_internship</strong> and <strong>id_supervisor_internship</strong>. In the table business_contacts I have 1 primary key <strong>id_business</strong>. I'm trying to get data from the business_contacts table which is linked to the internships table. Is the following query correct?</p>
  
  <pre>       public function update_form_business_contact($name_enterprise){
          $query = "
               SELECT 
                    * 
               FROM business_contacts
                    ,internships 
               WHERE 
                    business_contacts.id_business = internships.id_supervisor_internship 
                    AND internships.name_enterprise_internship = '$name_enterprise'";     
          $result = $this->_db->query($query);
  
          # Go through results of teachers
          if($result->rowCount()!=0){
              while($row=$result->fetch()){
                  $contact= new businesscontact ( $row->id_business,$row->firstname_business,$row->lastname_business,$row->service_business,$row->function_business,$row->phone_business,$row->phone_secretary_business,$row->mobile_business);
              }
          }
          return $contact;
      }</pre> 
  
  <p>My question is: Does the primary key have to reference both foreign keys? If so how would I do that.
  Thanks for your help.</p>