PHP ODBC connection to H2 database
could you please assist me with this.
I'm trying to connect to a H2 Database using PHP OBDC and I get the following error message: "SQL error: [unixODBC]Unknown authentication type, SQL state 28000 in SQLConnect"
I use the following to connect: $DSN = "Driver=PostgreSQL;Server=$Srv;Port=5435;Database=$DB;"; $CID = odbc_connect($DSN,$usr,$pwd);
How 开发者_如何学Cdo i parse the Authentication type in the connection string.
Thanks.
Try including the user and password in the connection string
$DSN = "Driver=PostgreSQL;Server=$Srv;Port=5435;Database=$DB;UID=$usr;PWD=$pwd";
I managed to get this working through the PHP functions for Postgres SQL.
$conn = pg_connect("host=[host] port=[port number] dbname=[database name] user=[username] password=[password]");
精彩评论