Author Topic: hi need help  (Read 373 times)

0 Members and 1 Guest are viewing this topic.

Offline tushar9xxTopic starter

  • Irregular
  • Posts: 1
    • View Profile
hi need help
« on: June 15, 2010, 01:31:42 PM »
Hi I am very new in PHP programming. I am having problem with connecting mysql database. My web browser is showing me the following errors:
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 'Europe/London' for '1.0/DST' instead in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\what.php on line 4 Warning: mysql_connect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\what.php on line 4 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 'Europe/London' for '1.0/DST' instead in
E:\Program Files\Apache Software Foundation\Apache2.2
\htdocs\what.php on line 4 Warning: mysql_connect():
A connection attempt failed because the connected party
did not properly respond after a period of time, or
established connection failed because connected
host has failed to respond.
in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\what.php
on line 4 Warning: main(): 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/London' for '1.0/DST'
instead in E:\Program Files\Apache Software Foundation
\Apache2.2\htdocs\what.php on line 5 Fatal error: Maximum
execution time of 30 seconds exceeded in E:\Program Files\
Apache Software Foundation\Apache2.2\htdocs\what.php on line 5

i used these codes:<?php

ini_set('display_errors', 'on');
error_reporting(E_ALL);
mysql_connect();
?>

I tried few methods like adding in php.ini
[Date]
; Defines the default timezone used by the date functions
date.timezone = Europe/London

and

In a DOS shell :
>mysqld --standalone --timezone=GMT

But can't solve the problem.
My web server and mysql server is working properly.

Need help.........................Someone please!!!! Oh i live in london
and my system:
OS: windows server 2008 standard X86
Apache 2.2
PHP 5.3.2
MySQL

Offline B0b

  • Enthusiast
  • Posts: 89
    • View Profile
Re: hi need help
« Reply #1 on: June 15, 2010, 06:18:13 PM »
Connecting to your mySQL database is done this way:

$dbUser 'your_database_username';
$dbPass 'your_database_password';
$database 'your_database_name';

$dbCon mysql_connect'localhost'$dbUser$dbPass );
mysql_select_db$database$dbCon );


You should refer to this:

http://www.w3schools.com/php/php_mysql_connect.asp