introduction screenshots faq forum blog modules components download
Please use the search function and/or read the FAQ first.

Go to Topic: PreviousNext
Go to: Message ListNew TopicSearchLog InPrint View

PHP and MySQL -



Posted by: Jazz
August 12, 2008 05:45PM
Hello,
I've been trying to fix this problem for about 2-4 days now, i've searched on google,php site, mysql site and have tried basically everything i've found which could of some help.

The problem is when i use a script to conncet to the mysql database it says "could not find driver" the script is
<?php

$dsn = '
		mysql: host = localhost;
			 dbname = 01;
		';

$user 	  = 'root';

$password = '';

try
	{
		$dbh = new PDO($dsn, $user, $password, array(PDO::ATTR_AUTOCOMMIT => true));
	}

catch (PDOException $e)
	{
		echo('Connection Failed: ' . $e -> getMessage());
	}
?>
I have checked the php info and it said the PDO is enabled with mysql, i have even checked the php config file to see if it is enabled there and it is.

Please help me i don't want to buy hosting just to fix this as it's a waste of money if i don't do anything on it for a few weeks cause i can sometimes get side-tracked off the work.

I am absolutly sure it's nothing to do with the script i just included it just to show you what is causing the PDO error, please anything that could possible help fix the problem, even if you think i've already tried it xD

Thanks for all your help in advance ;)



Edited 1 time(s). Last edit at 08/12/2008 06:57PM by Jazz.
Options: ReplyQuote
Posted by: mega-squall
August 12, 2008 08:04PM
Hi Jazz,

If you want to connect a DBMS through PDO, you need 2 extensions : the generic pdo extension and a driver specific extension which will let your PDO connect to a certain type of DBMS. You seem to want to connect a MySQL DBMS, so you will need to install both of those extensions :

php_pdo.dll
php_pdo_mysql.dll

PDO is still under documented because it will be officially released for PHP6.
However, there are clues on the PDO drivers pages, here :
[php.net]
[php.net]

---
mega-squall
Options: ReplyQuote
Posted by: espacebleu
September 15, 2008 08:13AM
bonjour,
je viens d'installer easyphp, et lorsque je veux accéder à mon web local, le message suivant s'affiche:

Site en travaux
Attention : un problème technique (serveur MySQL) empêche l'accès à cette partie du site. Merci de votre compréhension.

Que se passe t il et que dois je faire?
Merci pour votre aide!
Options: ReplyQuote


Go to: Message ListSearchLog In
Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.