Hi,
Following php & mysql SP book 4th edition.
Seems I cannot figure this out:
<?php
$link = mysqli_connect('127.0.0.1', 'root', 'thewordyoucannot4get=password');
if (!$link)
{
$output = 'test to see MySQL server.';
include 'output.html.php';
exit();
}
if (!mysql_set_charset(!$link, 'utf8'))
{
$output = 'test to see MySQL server.';
include 'output.html.php';
exit();
}
if (!mysqli_select_db($link, 'ijdb'))
{
$output = 'test to see MySQL server.';
include 'output.html.php';
exit();
}
$output = 'test to see MySQL server.';
include 'output.html.php';
mysqli_close($link);
?>
This code produces the error:
Warning: mysql_set_charset() [function.mysql-set-charset]: It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Europe/Helsinki’ for ‘2.0/no DST’ instead in C:\Apache2\htdocs\php\learn\index.php on line 12
Warning: mysql_set_charset() expects parameter 2 to be resource, string given in C:\Apache2\htdocs\php\learn\index.php on line 12
test to see MySQL server.
Localhost
Apche 2.2.1.4
PHP: 5.3
MySQL: 5.1.42
enabled everything according to the book.