HubsInfo Network

Connect to an external MySQL server with PDO (without delay)

0 Members and 1 Guest are viewing this topic.

Add one space between mysql: and host (server IP address or dns name)
ex: "mysql: "

Code: [Select]
$conn = new PDO('mysql:host=;dbname=test_db;port=3306','username','password');

it will fail no matter what. However if you put a space between mysql: and host like this:

$conn = new PDO('mysql: host=;dbname=test_db;port=3306','username','password');