Connecting to Mysql from PHP 5.3.3

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Lex-Man
Forum Newbie
Posts: 4
Joined: Sun Oct 31, 2010 2:42 pm

Connecting to Mysql from PHP 5.3.3

Post by Lex-Man »

I have installed Mysql on my pc and am trying to connect to the database from my PHP enabled webserver.

Using the code:

<?php
ini_set('display_errors', 1);
mysql_connect("localhost", "php", "*****") or die(mysql_error());
echo "Connected to MySQL<br />";
?>

I get the error

Fatal error: Maximum execution time of 30 seconds exceeded in C:\testbed\document.php on line 3

if I use the wrong password I get the error:

Warning: mysql_connect(): Access denied for user 'php'@'localhost' (using password: YES) in C:\testbed\document.php on line 3 Fatal error: Maximum execution time of 30 seconds exceeded in C:\testbed\document.php on line 3

What can I try to solve this problem?
Lex-Man
Forum Newbie
Posts: 4
Joined: Sun Oct 31, 2010 2:42 pm

Re: Connecting to Mysql from PHP 5.3.3

Post by Lex-Man »

Ok fixed this problem.
Post Reply