Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9076815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:11:34+00:00 2026-06-16T19:11:34+00:00

After a long time using mysql I finally decided to migrate everything to PDO

  • 0

After a long time using mysql I finally decided to migrate everything to PDO as the prior is being depreciated.

I began by looking into some tutorials on using PDO, and right from the start I am having problems…

I am running:

Apache (v2.2.22)
MySQL (v5.5.28)
PHP5

I am using the following block of code in PHP:

try{
    echo "PDO Connecting";
    $Connection = PDO("mysql:host=localhost;dbname=my_database;charset=UTF-8", "username", "passwd");
    echo "Connected";
}catch(PDOException $ex){
    echo "Error!";
}

My problem is that I see the message PDO Connecting, and then nothing… No Connected message, nor error message… Any thoughts as to what the problem is and how to fix it?

Is PDO the best route? Or should I look into MySQLi instead?

EDIT

Results from var_dump(PDO::getAvailableDrivers());

array(2) { [0]=> string(5) “mysql” [1]=> string(6) “sqlite” }

Results from Apache error.log

PHP Fatal error: Call to undefined function PDO() in /path/to/file.php on line 33

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:11:35+00:00Added an answer on June 16, 2026 at 7:11 pm

    You missed the “new” keyword.

        $Connection = new PDO(......)
    

    Make sure that you turn the error_reporting on to catch further errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using Symfony for a long time but I'm new to Symfony2. After
after googling for a long time, I decided to ask this: I've uploaded a
After long time of searching the best upload technique I've decided to go with
I've been using MySQL for quite some time, and I've decided to learn Postgres.
After a long time learning python I finally managed to make some breakthroughs: I'm
So after a long time of debugging here is whats happening. (Using Facebooks Graph
After a long time searching and trying I'm asking now for help: My situation:
After searching a long time for a performance bug, I read about denormal floating
How long after a document is fed to the Google Search Appliance using a
I am coming back to facebook app development after a long time. And I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.