I'm running hosting through Godaddy and update the code direct on the server. Instead of running it local and then uploading it to the server. The only problem is that I don't get any error messages that I usually would get when I run it locally using WAMP.
Right now I'm trying to fetch data using MySQL, but I only get a blank page.
require_once('../db.php');
$countyArr = mysql_query(SELECT `County` FROM `Infectious_Disease_Cases_by_County`);
while($rows = mysql_fetch_array($countyArr))
{
$rows = $rows['County'];
echo $rows;
}
?>
db.php
<?php
$username = "user";
$password = "pass";
$hostname = "localhost";
$dbname = "db_test";
try {
$dbh = new PDO("mysql:host=$hostname;dbname=$dbname",$username,$password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line
echo 'Connected to Database<br/>';
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>
Questions:
- How do I activate error handling like the one I get with WAMP?
- Where do I go wrong in this specific code?