Jump to content

Php Tutorial Stuck Already


kate
 Share

Recommended Posts

Hi again,this is my first foray into php and i'm stuck. I've been looking at the php tutorial and have been pretty much just copying and pasting to try and start working out how everything goes. My problem at the moment is the db.php script which acesses a table in mysql, i can't get it to work and I'm pretty sure i've created said table... I'm using easyPHP to run things locally and I imagine it's something to do with what I've put as host/user/password etc, mainly because that's the only thing i've changed in the script so far. has anyone run anything similar in easyPHP and know how it goes? Thankyou!This is the db.php file with what i've got for host etc;<?php$database_host = 'localhost';$database_user = 'root';$database_password = '';$database_name = '';$con = mysql_connect($database_host, $database_user, $database_password) or exit(mysql_error());mysql_select_db($database_name, $con) or exit (mysql_error());function db_query($sql){ return mysql_query($sql, $GLOBALS['con']);}?>

Link to comment
Share on other sites

this is the error message:Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\Program Files (x86)\EasyPHP-5.3.1\www\db.php on line 8Warning: mysql_connect() [function.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 C:\Program Files (x86)\EasyPHP-5.3.1\www\db.php on line 8Fatal error: Maximum execution time of 60 seconds exceeded in C:\Program Files (x86)\EasyPHP-5.3.1\www\db.php on line 8thanks, K

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...