AmitAsthana

In reply to by Eric

Thanks for the great article and and for important discussions by all of you.

I have tried with

$db = new PDO("dblib:host=243.234.234.232;dbname=dbname", "user", "pswd");

and got

Unable to open database.
Error message:

exception 'PDOException' with message 'could not find driver' in /var/www/html/ll/test/test.php:7 Stack trace: #0 /var/www/html/ll/test/test.php(7): PDO->__construct('dblib:host=198....', 'hipcask', 'logic9944') #1 {main}.

When I use

$db = new PDO('odbc:Driver=FreeTDS; Server=63.45.32.34; Port=1433; Database=database; UID=user; PWD=pswd;');

I get

Unable to open database.
Error message:

exception 'PDOException' with message 'SQLSTATE[IM002] SQLDriverConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified' in /var/www/html/ll/test/test.php:5 Stack trace: #0 /var/www/html/ll/test/test.php(5): PDO->__construct('odbc:Driver=Fre...') #1 {main}.

Any help would be greatly appreciated.

Sat, 27/06/2015 - 08:14 Permalink

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <p> <br> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA