note 118381 deleted from pdo.connections by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:56:23 +0000 |
| Subject: | note 118381 deleted from pdo.connections by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215379@lists.php.net to get a copy of this message | ||
Note Submitter: ogierschelvis at gmail dot com
----
As http://stackoverflow.com/questions/17630772/pdo-cannot-connect-remote-mysql-server
points out; sometimes when you want to connect to an external server like this:
<?php
$conn = new
PDO('mysql:host=123.4.5.6;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:
<?php
$conn = new PDO('mysql:
host=123.4.5.6;dbname=test_db;port=3306','username','password');
?>
it will magically work. I'm not sure if this applies in all cases or server setups. But I think
it's worth mentioning in the docs.