I downloaded this code but i dont understand and edit.
please help me.
I would like to know that is $host and $useame.
If i get a public server how do I change it
<?php
class Database
{
private $host = "localhost";
private $db_name = "test";
private $useame = "root";
private $password = "";
public $co;
public function dbCoection()
{
$this->co = null;
try
{
$this->co = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->useame, $this->password);
$this->co->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $exception)
{
echo "Coection error: " . $exception->getMessage();
}
retu $this->co;
}
}
?>
