waynew Posted June 23, 2008 Share Posted June 23, 2008 Can anyone see what is wrong with this because I can't seem to print out the contact names? Cheers guys. $result = mysql_query("SELECT * FROM jobs WHERE status = 2") or die(mysql_error); $i = 0; $j = 0; while($row = mysql_fetch_array($result)){ $comp_name[$i] = $row['company_name']; $address_one[$i] = $row['address1']; $address_two[$i] = $row['address2']; $county[$i] = $row['county']; $tender_reg_date[$i] = $row['reg_date']; //How many contacts from that company. $contactresult = mysql_query("SELECT DISTINCT contact_name FROM jobs WHERE status = 2 AND company_name = '$comp_name[$i]'") or die("Error in customer select"); while($row = mysql_fetch_array($contactresult)){ if($row['contact_name'] != "" && $row['contact_name'] != " " && $row['contact_name'] != "-"){ $contact_name[$i][$j] = $row['contact_name']; $j++; echo $row['contact_name']."<br/>"; } else{ $contact_name[$i][$j] = "Sir or Madam"; } } $i++; } Snippet of print: <p><font face=\"Times New Roman, Times, serif\">Dear".$contact_names[6][0].",</font></p> Any help would be greatful. Link to comment https://forums.phpfreaks.com/topic/111457-whats-wrong/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.