Results 1 to 5 of 5
  1. #1

    Default help!!!cant connect to mysql database...


    whats wrong with my code?
    why cant i connect to my database called "mydb"?
    why is it that the adapter doesnt load infact im using factory?



    <?php
    require_once 'Zend/Config.php';
    require_once 'Zend/Db.php';
    require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
    require_once 'Zend/Loader.php';

    try {

    $config = array(
    'host' => 'localhost',
    'username' => '',
    'password' => '',
    'dbname' => 'mydb',
    );

    $db = Zend_Db::factory('PDO_MYSQL', $config);
    $db->getConnection();
    echo "yahoooo";

    } catch (Zend_Db_Adapter_Exception $e) {
    echo $e;
    } catch (Zend_Exception $e) {
    echo $e;
    }

    ?>

    the output is this...

    "exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in C:\PHP\includes\Zend\library\Zend\Db\Adapter\Pdo\A bstract.php:95 Stack trace: #0 C:\PHP\includes\Zend\library\Zend\Db\Adapter\Abstr act.php(271): Zend_Db_Adapter_Pdo_Abstract->_connect() #1 C:\Apache Group\Apache2\htdocs\public\lib\dbconnect.php(33): Zend_Db_Adapter_Abstract->getConnection() #2 {main} "


  2. #2

    Default Re: help!!!cant connect to mysql database...

    You need to load the PDO extension (http://www.php.net/pdo). Execute the following code to see all your available extensions:
    Code:
    <?php
      phpinfo();
    ?>

  3. #3

    Default Re: help!!!cant connect to mysql database...

    thanks...got it...

  4. #4

    Default Re: help!!!cant connect to mysql database...

    try catch d.i.. hehehehe.. hmmmm.. kamao jud ni c simon cpu noh? galing mow toL...

  5. #5

    Default Re: help!!!cant connect to mysql database...

    if youre in local host, enable the PHP pdo extension on your wamp or apache triad web server...

  6.    Advertisement

Similar Threads

 
  1. Replies: 0
    Last Post: 04-13-2010, 08:52 PM
  2. Help: vb6 connect to MySQL
    By sunduwu in forum Programming
    Replies: 0
    Last Post: 03-22-2010, 11:03 AM
  3. help, i cant connect to itunes store
    By whoopz in forum Software & Games (Old)
    Replies: 0
    Last Post: 02-16-2010, 10:03 PM
  4. Connecting to MySQL Database
    By raybanz21 in forum Programming
    Replies: 8
    Last Post: 03-08-2009, 04:07 PM
  5. cant connect to PLDTplay.com
    By alvinladen in forum Software & Games (Old)
    Replies: 6
    Last Post: 08-26-2005, 07:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top