Jump to content

Get data from multiple tables and put in Columns


travelkind

Recommended Posts

I am looking for the easiest way to get data from multiple mysql tables and have the results displayed in columns.  Here is a sample of my code which only lists data in a vertical line.  Thanks for your help!

 

<?php

 

$dbhost = "xxxx";

$dbuser = "xxxx";

$dbpassword = "xxxx";

 

$dbdatabase = "ccfee";

 

$db = mysql_connect($dbhost, $dbuser, $dbpassword);

mysql_select_db($dbdatabase, $db);

 

$sql = "SELECT * FROM sunocoimport;";

$result = mysql_query($sql);

 

while($row = mysql_fetch_assoc($result)) {

  echo $row['cc_fees'] . "<br />";

}

 

$sql = "SELECT * FROM custmast;";

$result = mysql_query($sql);

 

while($row = mysql_fetch_assoc($result)) {

  echo $row['cust'] . "<br />";

}

 

?>

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.