set_charset('utf8');
return $dbConnection;
}
}
$db_conn = db_connect();
$noDb = true;
$result = '';
$randomId = rand(1, 5);
if ($dbQuery = $db_conn->query("SELECT quote FROM demo WHERE id=".$randomId)) {
if ($dbRow = $dbQuery->fetch_row()) {
if (!empty($dbRow[0])) {
$result = 'This is Web Server 2 connected to a Database, and got the following quote:
'.$dbRow[0].'';
$noDb = false;
}
}
}
if ($noDb) {
$result = 'This is Web Server 2, and it is still not connected to a Database.';
}
$db_conn->close();
?>