I have to build a php website which has to connect to an Ingres database server.
I have downloaded sourceforge pjbs JDBC-PHP bridge. I installed this in the project folder and tried to connect to my ingres database. I don't understand which parameters fsockopen() needs, for the databasehost (VMS server) I use the vnode but ingres uses a string as port and fsockopen wants to have an integer. I use php 7.2.3 on Windows 7 Ingres 9.2 on HP OpenVMS v.8.4
<?php
require "lib/PJBridge.php";
function get_connection()
{
$connStr = "jdbc:ingres://vnode:II7/dbname";
$db = new PJBridge();
$result = $db->connect($connStr, $user, $password);
if(!$result){
die("Failed to connect");
}
return $result;}
<?php
class PJBridge {
private $sock;
private $jdbc_enc;
private $app_enc;
public $last_search_length = 0;
function __construct($host="vnode", $port=-1, $jdbc_enc="ascii", $app_enc="ascii") {
$this->sock = fsockopen($host, $port);
$this->jdbc_enc = $jdbc_enc;
$this->app_enc = $app_enc;
}