Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Connect to DB Problem

witgrefe's profile image witgrefe posted 1 month ago in Creating a connection Permalink

I am trying to connect to a HeidiSQL db using php PDO on a linux machine. I cannot. This is the code I am using:

$dsn = "mysql:host=$host;dbname=$db;charset=$charset";

try {
            $conn = new PDO("mysql:host=$severname;dbname=$db", $user, $pass);
            $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            echo "Connected successfully";
      }
      catch(PDOException $e) {
           echo "Connection failed:".  '</br>' . $e->getMessage();

The error returned is: could not find driver

Can someone help please

}

Please login to leave a reply, or register at first.