I'm currently working on styling the layout of my MySQL database results using a combination of HTML and CSS.
My goal is to have all the "hi's" displayed under the column labeled "Good Comment," while the "asasd" and 4 occurrences of "BAD" should be placed under the corresponding column named "Bad Comment."
For some reason, this setup doesn't seem to be functioning as intended.
Here's a snippet of the CSS code I am using:
.leftSide {
display: inline-block;
vertical-align: top;
width: 500px;
}
.goodComments {
display: inline-block;
width: 500px;
}
.rightSide {
display: inline-block;
vertical-align: top;
width: 300px;
}
.badComments {
display: inline-block;
margin-left: 500px;
width: 300px;
}
PHP:
function fetchBad()
{
try {
$dbh = new PDO("mysql:host=$hostname;dbname=ProCons", $username, $password);
$sql = "SELECT * FROM ConSubmissions";
foreach ($dbh->query($sql) as $row) {
echo $row['Comments'] .' - '. $row['TimeStamp'] . '<br />';
}
$dbh = null;
} catch(PDOException $e) {
echo $e->getMessage();
}
}