Jump to content

php connecting to mysql error help.


prakash911

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.