I have a page which displays a list of items found in mysql database. This page is a classifieds page, so users will be able to see the submitted information on this page.
I'd like to know how I would create the divs then fill them with mysql information straight from the database. Heres some code.
<?php
//load database connection
$host = "localhost";
$user = "root";
$password = "root";
$database_name = "ctrader";
$pdo = new PDO("mysql:host=$host;dbname=$database_name", $user, $password, array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
));
include('Specials.html');
$query = $pdo->prepare("SELECT * FROM adsubm WHERE CATEGORY LIKE 'Specials'");
while($row = mysql_fetch_array($result))
{
echo "<div>".$row['Name']."</div>";
}
?>
I've been so confused with this that I just included the html for safety, my knowledge on such is very limited. All answers are appreciated, Thanks.