// Database Settings
define('DB_HOST', '******');
define('DB_PORT', '******');
define('DB_USER', '******');
define('DB_PASS', '******');
define('DB_NAME', '******');
// Connection to Database
$database = new MySQLi(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);
$sql = 'SELECT AManufactureBrand.brand, AManufactureModel.model, AManufactureEdition.edition'
. ' FROM AManufactureModel'
. ' INNER JOIN AManufactureBrand ON AManufactureModel.brand_id = AManufactureBrand.brand_id'
. ' INNER JOIN AManufactureEdition ON AManufactureModel.model_id = AManufactureEdition.model_id'
. ' WHERE AManufactureEdition.edition=\'345i\'';
$resultSet = $database->query($sql);
// Begin building some HTML output
$html = '<table border="0">
<tr>
<th>Editions</th>
</tr>';
while ($row = $resultSet->fetch_assoc())
{
$html .= '<tr><td>' . $row['brand'] . '</td></tr>';
$html .= '<tr><td>' . $row['model'] . '</td></tr>';
$html .= '<tr><td>' . $row['edition'] . '</td></tr>';
}
$html .= '</table>';
echo $html;
?>
For example this query calls up BMW 3Series 345i, I have two results from mysql printed to a table on my website. The problem the two records print out on one column going down onwards.
Currently I get a result like this on my webpage two mysql records printing vertical down one column.
I'm trying to make it go across like this and print multiple cars next to each-other horizontally across.