i made an array for my connection to mysql
/ connect to a database /
function connect($args) {
switch($this->type) {
case "mysql":
/ mysql /
if (!$args[username] || !$args[password]) {
$ret = false;
trigger_error("connect needs at least username and password",
E_USER_ERROR);
break;
}
if ($args["persist"] == "yes") {
$this->dbh = @mysql_pconnect($args[host], $args[username], $args[password]);
} else {
$this->dbh = @mysql_connect($args[host], $args[username], $args[password]);
}
if ($this->dbh) {
$ret = true;
} else {
$errorstring = "Failed to connect to database '" .
$args[database] . "' with username '" .
$args[username] . "' and password '" .
$args[password] . "'";
if ($args[host]) {
$errorstring .= " on host '" . $args["host"] . "'";
}
error_log($errorstring);
$ret = false;
}
break;
default:
$ret = false;
break;
}
return $ret;
}
but it keep guiving me an error and say that no password was entered abd i did redirect this to my array with all the nessarie info.