pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
can somebody show me a MDB2 dsn with port number?
3+ messages / 2 participants
[nested] [flat]

* can somebody show me a MDB2 dsn with port number?
@ 2006-05-20 17:49 kmh496 <kmh496@kornet.net>
  2006-05-20 18:09 ` Re: can somebody show me a MDB2 dsn with port number? Jeff MacDonald <jam@zoidtechnologies.com>
  2006-05-20 18:14 ` Re: can somebody show me a MDB2 dsn with port number? Jeff MacDonald <jam@zoidtechnologies.com>
  0 siblings, 2 replies; 3+ messages in thread

From: kmh496 @ 2006-05-20 17:49 UTC (permalink / raw)
  To: 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@protocol+hostspec:110//usr/db_file.db?mode=0644
2       phptype://username:password@hostspec/database_name
3       phptype://username:password@hostspec
4       phptype://username@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.









^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: can somebody show me a MDB2 dsn with port number?
  2006-05-20 17:49 can somebody show me a MDB2 dsn with port number? kmh496 <kmh496@kornet.net>
@ 2006-05-20 18:09 ` Jeff MacDonald <jam@zoidtechnologies.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jeff MacDonald @ 2006-05-20 18:09 UTC (permalink / raw)
  To: kmh496 <kmh496@kornet.net>; +Cc: pgsql-php

greetings,

your question would be more appropriate to one of the PEAR lists, but I
will answer it anyway.

On Sun, 2006-05-21 at 02:49 +0900, kmh496 wrote:
> 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@protocol+hostspec:110//usr/db_file.db?mode=0644
[..snipped..]
> can somebody cut and paste me one please?
> thanks everybody.
> joseph.

http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php

specifically, look at the line that describes the "hostspec" ("Host
Specification").

regards,
J
-- 
Jeff MacDonald
Zoid Technologies, http://zoidtechnologies.com/




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: can somebody show me a MDB2 dsn with port number?
  2006-05-20 17:49 can somebody show me a MDB2 dsn with port number? kmh496 <kmh496@kornet.net>
@ 2006-05-20 18:14 ` Jeff MacDonald <jam@zoidtechnologies.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jeff MacDonald @ 2006-05-20 18:14 UTC (permalink / raw)
  To: kmh496 <kmh496@kornet.net>; +Cc: pgsql-php

On Sun, 2006-05-21 at 02:49 +0900, kmh496 wrote:
> hello pgsql-php,
> 
> i looked for a sample of MDB2 dsn array with port number, couldn't find
> one.
[..snipped..]
> can somebody cut and paste me one please?
> thanks everybody.
> joseph.

see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
example 33-2 towards the bottom of the page.

regards,
J
-- 
Jeff MacDonald
Zoid Technologies, http://zoidtechnologies.com/




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-05-20 18:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-20 17:49 can somebody show me a MDB2 dsn with port number? kmh496 <kmh496@kornet.net>
2006-05-20 18:09 ` Jeff MacDonald <jam@zoidtechnologies.com>
2006-05-20 18:14 ` Jeff MacDonald <jam@zoidtechnologies.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox