Skip site navigation (1) Skip section navigation (2)

can somebody show me a MDB2 dsn with port number?

From: kmh496 <kmh496(at)kornet(dot)net>
To: pgsql-php(at)postgresql(dot)org
Subject: can somebody show me a MDB2 dsn with port number?
Date: 2006-05-20 17:49:29
Message-ID: 1148147370.7568.30.camel@var.sirfsup.com (view raw or flat)
Thread:
Lists: pgsql-php
hello pgsql-php,

i looked for a sample of MDB2 dsn array with port number, couldn't find
one.
my dsn without it is:
$dsn_postgresql=array(
    'phptype' => "pgsql",
    'username' => $pg_username,
    'password' => $pg_password,
    'hostspec' => "localhost",
    'database' => $pg_database
);
$options = array(
    'debug'       => 9,
    'portability' => DB_PORTABILITY_ALL,
);

the MDB2 docs have just


Most variations are allowed: 


1     phptype://username:password(at)protocol+hostspec:110//usr/db_file.db?mode=0644
2       phptype://username:password(at)hostspec/database_name
3       phptype://username:password(at)hostspec
4       phptype://username(at)hostspec
5       phptype://hostspec/database
6       phptype://hostspec
7       phptype(dbsyntax)
8       phptype

* I don't see PORTNUMBER in there anywhere*

"Additional keys can be added by appending a URI query string to the end
of the DSN."
what does that mean?


and my connect call is

    global $dsn_mysql,$dsn_postgresql,$DEBUG_DICT_CONNECT,$options;
    // default has always been mysql, if (!$dsn) $dsn = $dsn_mysql;
    // if (!$dsn) $dsn = $dsn_postgresql;
    if (!$dsn) $dsn = $dsn_mysql;
    // Retries connection to server 5 times.
    if ($DEBUG_DICT_CONNECT) echo "dsn = " . print_r($dsn) . "<br>";
    if ($DEBUG_DICT_CONNECT) echo "dsn = " . print_r($dsn) . "<br>";
    $db = MDB2::connect($dsn,$options);


I have tried   
$pg_options = array(
    'portnumber'       => 5534,
    'debug'       => 9,
    'portability' => DB_PORTABILITY_ALL,
);

but connection fails.



can somebody cut and paste me one please?
thanks everybody.
joseph.







Responses

pgsql-php by date

Next:From: Jeff MacDonaldDate: 2006-05-20 18:09:36
Subject: Re: can somebody show me a MDB2 dsn with port number?
Previous:From: Randy MollerDate: 2006-05-19 13:39:42
Subject: Re: Adding to multiplied values

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group