Jump to content

Creating Columns using PHP


rscott7706

Recommended Posts

Hello, as in many cases, brand new to MYSQL and PHP.

I have a 119 record MYSQL that I am querying through PHP. I would like to display as three columns.

Here is some of the code, is there a way to use this code then disply as three equal columns?

<?php
$db = mysql_connect("localhost", " ", " ");
mysql_select_db(" ");
$query = "SELECT * FROM members";

$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)){
echo $row['Company_Name'];
echo "<br />";
echo "Contact: ";
echo $row['First_Name'] . " ". $row['Last_Name'];
echo "<br />";
echo $row['Mailing_Address'];
echo "<br />";
echo $row['Mailing_City']. ", ". $row['Mailing_State']. " ". $row['Mailing_Zip_Code'];
echo "<br />";
echo "Phone: ";
echo $row['Phone_Number'];
echo "<br />";
echo "Fax: ";
echo $row['Fax_Number'];
echo "<br />";
echo "<br />";
}
?>

Thanks in advance!

Ron Scott
Link to comment
https://forums.phpfreaks.com/topic/4377-creating-columns-using-php/
Share on other sites

  • 2 years later...

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.