1
votes

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 do i parse the Authentication type in the connection string.

Thanks.

2

2 Answers

0
votes

Try including the user and password in the connection string

$DSN = "Driver=PostgreSQL;Server=$Srv;Port=5435;Database=$DB;UID=$usr;PWD=$pwd";
0
votes

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]");