Filtration Plants

Filtration Plants

View CBF Filtration Plants in a full screen map


[insert_php]
//echo “Welcome to PHP”;

// database connection
$host = “localhost”;
$dbname = “shahzad_cbf”;
$user = “shahzad”;
$pw = “P(zxtgaH^W)?”;
try{
$pdo = new PDO(“mysql:host=$host;dbname=$dbname”, “$user”, “$pw”);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec(“SET NAMES ‘utf8′”);
//echo “

Connected to db – $dbname

“;
}catch(PDOException $e){
$error = “

Unable to connect to database.

“;
//include “includes/error.html.php”;
echo “

Unable to connect to db – $dbname

“;
exit();
}

//——————————–

try{
$sql = “SELECT *
FROM `cbf_filtration_plants`”;
$result = $pdo->query($sql);

}catch(PDOException $e){
$error = “Error fetching Filtration Plants – “.$e->getMessage();
echo $error;
exit();
}
foreach($result as $row){
$plants[]= array(
‘id’=>$row[‘id’],
‘address’=>$row[‘address’],
‘location’=>$row[‘location’]
);
}

echo “

    “;
    foreach ($plants as $plant) {
    echo “
  1. “.$plant[‘address’].” – “.$plant[‘location’].”
  2. “;
    }
    echo “

“;

[/insert_php]