hi everyone i am new to db websites and theses forums i have brought the book by kevin yank database driven websites and i have got to chapter 4 and followed it word by word but i am haveing a problem with the database error:
Warning: mysqli_connect() [function.mysqli-connect]: (/838860800):
what is happening it should say
unable to connect to the database server.
this is when i changed the password to test see if it is working when i use the correct password it says connected to database but when it says chage password to see if it gives the unable to connect to the database server. i get this error above i have unistalled it and reinstalled the software but all that happens is it changes the number in the error this is the code from the book and i cant work this error out can anyone help me asap thanks.
the code:
<?
$link = mysqli_connect(‘localhost’, ‘root’, ‘bail’);
if (!$link)
{
$output = ‘unable to connect to the database server.’;
include ‘output.html.php’;
exit();
}
if (!mysqli_set_charset ($link, ‘utf8’))
{
$output = ‘unable to set database connecion encoding.’;
include ‘output.html.php’;
exit();
}
if (!mysqli_select_db($link, ‘ijdb’))
{
$output = ‘unable to locate the joke database.’;
include ‘output.html.php’;
exit();
}
$output = ‘DATABASE CONNECTION ESTABLISHED.’;
include ‘output.html.php’;
?>
and the output code is :
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” <“http://www.w3.org/TR/xhtml1/DTD/xhtm
-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>Untitled Document</title>
</head>
<body>
<? echo $output; ?>
</body>
</html>