Jump to content

[SOLVED] Getting Data From more than one table with MYSQL


$username

Recommended Posts

So I have this code and I am trying to pull info from more then one table. i think I am close to getting this.

 

It does not display the info as of now.

 

Thanks

 

<br \>
<table width="900" border="2" rules="all" cellpadding="2" cellspacing="2" bordercolor="#000000" >
  <tr bgcolor="#CCCCCC">
    <td><strong>Case ID:</strong></td>
    <td><strong>Contact Email</strong></td>
    <td><strong>Contact Phone</strong></td>
    <td><strong>Contact Fax</strong></td>
  </tr>
<?PHP
$AccNumber = $_GET['AccNum'];
$sql162 = "SELECT cases.CaseID, cases.CaseSubject, cases.CaseOwner, cases.CaseAccountID, contacts.ContactFname, contacts.ContactLname, contacts.ContactAccountNumber, account.AccountName, account.AccountNumber FROM cases, contacts, account WHERE CaseAccountID = '$AccNumber'  LIMIT 0,9";
$query162 = mysql_query($sql162);

while($row162 = mysql_fetch_array($query162)) {

//echo "<tr>";

echo "<tr>";	  
//echo("<td><a href=\"viewaccount.php?AccNum=" .  $row["AccountNumber"] . "\" title=\"".$row["AccountID"]."\">" . $row["AccountID"] .  "</a></td>"); 
echo "<td>".$row162['ContactFname']."</td>";
echo "<td>".$row162['CaseSubject']."</td>";
echo "<td>".$row162['CaseOwner']."</td>";
echo "<td>".$row162['AccountName']."</td>";

echo "</tr>";
}

?>
</table>

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.