Class 'PDO' not found in
Posted: Sat Mar 07, 2009 9:35 pm
Hi,
I am having issues when connecting to MySQL from PHP.
This is the error I get
Fatal error: Class 'PDO' not found in 'xxxx' on line 4
Here's the code:
I am using/learning Prado framework for PHP
If it is something very obvious, sorry about that, but I need some advice.
I have googled and searched forums and understood and implemented most of the soultions, but nothing has helped so far
thanks a lot
posting.php?mode=post&f=31#
I am having issues when connecting to MySQL from PHP.
This is the error I get
Fatal error: Class 'PDO' not found in 'xxxx' on line 4
Here's the code:
Code: Select all
<?php
Prado::using('System.Web.UI.ActiveControls.*');
Prado::using('System.Data.*');
class Home extends TPage {
public function buttonClicked($sender,$param) {
// $sender refers to the button component
// Database connection, command class
$db_connection = new TDbConnection("mysql:host=localhost;dbname=Exposure","root","Exposure");
//$db_connection = $this->Application->Modules['dbConnection']->DbConnection;
$db_connection->Active;
echo 'hello';
echo $this->Application->Modules['dbConnection']->DbConnection;
echo $db_connection->ConnectionStatus;
$sql_query = "Select * from User";
$command = $db_connection->createCommand($sql_query);
// Redirect to next page
//$this->Response->Redirect("./protected/pages/Next.php");
/*$this->btnSubmit->enabled = "false";*/
}
}
?>
If it is something very obvious, sorry about that, but I need some advice.
I have googled and searched forums and understood and implemented most of the soultions, but nothing has helped so far
thanks a lot
posting.php?mode=post&f=31#