travelkind Posted October 27, 2009 Share Posted October 27, 2009 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 />"; } ?> Link to comment https://forums.phpfreaks.com/topic/179245-get-data-from-multiple-tables-and-put-in-columns/ Share on other sites More sharing options...
mikesta707 Posted October 27, 2009 Share Posted October 27, 2009 look into Join clicky Link to comment https://forums.phpfreaks.com/topic/179245-get-data-from-multiple-tables-and-put-in-columns/#findComment-945719 Share on other sites More sharing options...
travelkind Posted October 27, 2009 Author Share Posted October 27, 2009 Thanks Mikesta707. I went to their website and will go over their information. Link to comment https://forums.phpfreaks.com/topic/179245-get-data-from-multiple-tables-and-put-in-columns/#findComment-945726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.