Jump to content

Recommended Posts

the error message i get is:

 

Warning: mysql_connect(): 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 'America/New_York' for '-4.0/DST' instead in C:\Users\Kash\Documents\My Web Sites\LU Books\db_connect.php on line 8 Warning: mysql_connect(): Connecting to 3.22, 3.23 & 4.0 is not supported. Server is 4.0.16-nt in C:\Users\Kash\Documents\My Web Sites\LU Books\db_connect.php on line 8 Warning: mysql_connect(): 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 'America/New_York' for '-4.0/DST' instead in C:\Users\Kash\Documents\My Web Sites\LU Books\db_connect.php on line 8 Warning: mysql_connect(): Connecting to 3.22, 3.23 & 4.0 servers is not supported in C:\Users\Kash\Documents\My Web Sites\LU Books\db_connect.php on line 8

 

 

the line the error is coming from or rather i posted the whole file:

 

<?php

function db_connect()

{

  $host_name = "localhost:3306";

  $user_name = "root";

  $password = "chennupati";

  $db_name = "bookstore";

  $db_link = mysql_connect($host_name, $user_name, $password) or die("<html><script language='JavaScript'>alert('Unable to connect to database! Please try again later.'),history.go(-1)</script></html>");

  mysql_select_db($db_name) or die("Could not select database $db_name");

  return $db_link;

}

?>

 

 

and in my script i am using this call to access the function:

 

$db_link = db_connect();

 

 

can someone please tell what this error means and how i can fix this.

Link to comment
https://forums.phpfreaks.com/topic/195345-php-connecting-to-mysql-error-help/
Share on other sites

A) Read the errors messages.

B) You have not set a default time zone setting for php to use.

C) The version of mysql is too old and is not supported by the client library that php is using to connect to the database.

i installed mysql version mysql-4.0.16-win.zip on my pc, guys some other news that might help figure out the problem. i am using microsoft web expression 3, do i have to manually do something with web expression program for it to connect to mysql server or is this the right way.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.