Ik heb een script veranderd en wat uitgebreid tot dit gemaakt.
Wie kan mij zeggen wat ik er nog aan kan veranderen.
Connect class
PHP
class Connect
{
public function connect($host, $user, $pass ,$db)
{
$this->link = @mysql_connect($host, $user, $pass);
if(!$this->link)
{
echo mysql_error();
die;
}
if (!@mysql_select_db($db, $this->link))
{
echo mysql_error();
die;
}
}
public function query($query)
{
$this->connect($this->host, $this->user, $this->pass, $this->db);
$result = mysql_query($query, $this->link);
if(!$result) {
echo mysql_error($this->link);
die;
}
return $result;
}
public function fetch($query, $type)
{
if ($type == "assoc")
{
return mysql_fetch_assoc($sql);
}
elseif ($type == "object")
{
return mysql_fetch_object($sql);
}
}
}
Toon Meer
Alles is welkom (ook negatief)
Mvg.