Uncaught PDOException: could not find driver

I’m using POD (php) to connect to mysql.

POD Script

<?php // Database connection // ================================================== $host = '127.0.0.1'; $user = 'server_436'; $password = 'harisree1'; $database_name = 'port_2538'; try { $pdo = new PDO("mysql:host=$host;dbname=$database_name", $user, $password); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo 'MySQL Error: ' . $e->getMessage(); die(); } ?>

The error…

Fatal error: Uncaught PDOException: could not find driver in /storage/ssd5/288/2329288/public_html/koneksi.php:2 Stack trace: #0 /storage/ssd5/288/2329288/public_html/koneksi.php(2): PDO->__construct(‘mssql:host=127…’) #1 /storage/ssd5/288/2329288/public_html/staff.php(3): include(’/storage/ssd5/2…’) #2 {main} thrown in /storage/ssd5/288/2329288/public_html/koneksi.php on line 2

wat to do?

Host is localhost
Please correct it.
DBUser can be found in cPanel
DBName can be found in cPanel
DBPassword is the password you set when creating the database.

Its not 000webhost’s mysql conection…!

its my server connection… which i am using to list things from it.

eg. http://www.uffserver.tk/staff.php

Hi @raaj!

Its not 000webhost’s mysql conection…!
its my server connection… which i am using to list things from it.

You have one MySQL database registered on your account: id2329288_sree. Locally, you can connect only to that one.

If you have another database hosted somewhere else, use the credentials from that database to connect to it

You are accessing MSSQL from 000webhost server where 000webhost server only has MySQL driver, not MSSQL driver.

On most NON-Windows server there won’t be any MSSQL driver on it so when you pick a host that you want to use MSSQL driver you must pick a hosting provider that either support MSSQL driver or pay for Windows hosting.

He is also using wrong credentials.

I want to know what are creditnails?,
Do you mean FTP connection?

Wrong credentails…???

I want to know what are creditnails?,

I mean the MySQL credentials.

Your credentials for 000webhost databases are located in 000webhost cPanel > Manage databases

If you have another database hosted somewhere else, use the credentials from that database to connect to it

I am using the other server credentials to connect to it… but 000webhost shows error(which u can see in that POD script which i posted).

but when i use it , it shows that error… But at first it was working fine, Now recently its not working.

Finally I mean , the host - 000webhost
Server - other DB

i am using other server DB. which 000webhost doesn’t support… Clearly i’m using Mysql only not others like Sql , mssql…

Is your MySQL database hosted on 000webhost?