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>

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.