så er der fejl i denne kode, har ikke prøvet den slags connect til db,
<?php
require_once 'DB.php';
$db_engine = 'mysql';
$db_user = '*';
$db_pass = '*';
$db_host = '*';
$db_name = '*';
$datasource = $db_engine.'://'.
$db_user.':'.
$db_pass.'@'.
$db_host.'/'.
$db_name;
$db_object = DB::connect($datasource, TRUE);
if the connection fails $db_object will contain
if(DB::isError($db_object)) {
die($db_object->getMessage());
}
$db_object->setFetchMode(DB_FETCHMODE_ASSOC);
include('check_login.php');
?>
kan jeg ikke bare sætte dette ind istedet?
$host="*";
$username="*";
$password="*";
$db_name="*";
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");