[PHP-CVS] cvs: php4 /pear/DB pgsql.php
cox Wed Apr 4 15:55:10 2001 EDT Modified files: /php4/pear/DB pgsql.php Log: as the row counter starts with 0, last row is before numrows Index: php4/pear/DB/pgsql.php diff -u php4/pear/DB/pgsql.php:1.36 php4/pear/DB/pgsql.php:1.37 --- php4/pear/DB/pgsql.php:1.36 Mon Apr 2 20:33:58 2001 +++ php4/pear/DB/pgsql.php Wed Apr 4 15:55:09 2001 @@ -91,7 +91,7 @@ } $connstr = 'host=' . $dsninfo['hostspec'] . ' port=' . $port; } - + if (isset($dsninfo['database'])) { $connstr .= ' dbname=' . $dsninfo['database']; } @@ -263,7 +263,7 @@ function fetchInto($result, &$row, $fetchmode, $rownum=null) { $rownum = ($rownum !== null) ? $rownum : $this->row[$result]; -if ($rownum > $this->num_rows[$result]) { +if ($rownum >= $this->num_rows[$result]) { return null; } if ($fetchmode & DB_FETCHMODE_ASSOC) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB pgsql.php
jon Mon Apr 2 20:33:58 2001 EDT Modified files: /php4/pear/DB pgsql.php Log: Style and whitespace. Index: php4/pear/DB/pgsql.php diff -u php4/pear/DB/pgsql.php:1.35 php4/pear/DB/pgsql.php:1.36 --- php4/pear/DB/pgsql.php:1.35 Mon Apr 2 20:27:46 2001 +++ php4/pear/DB/pgsql.php Mon Apr 2 20:33:58 2001 @@ -82,20 +82,31 @@ $protocol = (isset($dsninfo['protocol'])) ? $dsninfo['protocol'] : ''; $connstr = ''; if (($host !== false) && ($protocol != 'unix')){ -if (($pos=strpos(':', $host)) !== false) { +if (($pos = strpos(':', $host)) !== false) { $dbhost = substr($host, 0, $pos); -$port = substr($host, $pos+1); +$port = substr($host, $pos + 1); } else { $dbhost = $host; $port = '5432'; } -$connstr="host=".$dsninfo['hostspec']." port=".$port; +$connstr = 'host=' . $dsninfo['hostspec'] . ' port=' . $port; } -$connstr .= $dsninfo['database'] ? " dbname=".$dsninfo['database'] : NULL; -$connstr .= $dsninfo['username'] ? " user=".$dsninfo['username'] : NULL; -$connstr .= $dsninfo['password'] ? " password=".$dsninfo['password'] : NULL; -$connstr .= (!empty($dsninfo['options'])) ? " options=".$dsninfo['options'] : NULL; -$connstr .= (!empty($dsninfo['tty'])) ? " tty=".$dsninfo['tty'] : NULL; + +if (isset($dsninfo['database'])) { +$connstr .= ' dbname=' . $dsninfo['database']; +} +if (isset($dsninfo['username'])) { +$connstr .= ' user=' . $dsninfo['username']; +} +if (isset($dsninfo['password'])) { +$connstr .= ' password=' . $dsninfo['password']; +} +if (!empty($dsninfo['options'])) { +$connstr .= ' options=' . $dsninfo['options']; +} +if (!empty($dsninfo['tty'])) { +$connstr .= ' tty=' . $dsninfo['tty']; +} $connect_function = $persistent ? 'pg_pconnect' : 'pg_connect'; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB pgsql.php
jon Mon Apr 2 20:27:46 2001 EDT Modified files: /php4/pear/DB pgsql.php Log: Make the 'protocol' DSN element optional. Index: php4/pear/DB/pgsql.php diff -u php4/pear/DB/pgsql.php:1.34 php4/pear/DB/pgsql.php:1.35 --- php4/pear/DB/pgsql.php:1.34 Wed Mar 28 15:52:21 2001 +++ php4/pear/DB/pgsql.php Mon Apr 2 20:27:46 2001 @@ -79,8 +79,9 @@ { $this->dsn = $dsninfo; $host = $dsninfo['hostspec']; +$protocol = (isset($dsninfo['protocol'])) ? $dsninfo['protocol'] : ''; $connstr = ''; -if (($host !== false) && ($dsninfo['protocol'] != 'unix')){ +if (($host !== false) && ($protocol != 'unix')){ if (($pos=strpos(':', $host)) !== false) { $dbhost = substr($host, 0, $pos); $port = substr($host, $pos+1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/DB pgsql.php
jon Fri Mar 9 22:04:15 2001 EDT Modified files: /php4/pear/DB pgsql.php Log: Make the #options, $tty, and $port parameters optional. Index: php4/pear/DB/pgsql.php diff -u php4/pear/DB/pgsql.php:1.30 php4/pear/DB/pgsql.php:1.31 --- php4/pear/DB/pgsql.php:1.30 Mon Feb 19 04:22:26 2001 +++ php4/pear/DB/pgsql.php Fri Mar 9 22:04:14 2001 @@ -97,9 +97,9 @@ $user = $dsninfo['username']; $pw = $dsninfo['password']; $dbname = $dsninfo['database']; -$options = $dsninfo['options']; -$tty = $dsninfo['tty']; -$port = $dsninfo['port'] ? $dsninfo['port'] : '5432'; +$options = (!empty($dsninfo['options'])) ? $dsninfo['options'] : NULL; +$tty = (!empty($dsninfo['tty'])) ? $dsninfo['tty'] : NULL; +$port = (!empty($dsninfo['port'])) ? $dsninfo['port'] : '5432'; $connect_function = $persistent ? 'pg_pconnect' : 'pg_connect'; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]