Commit Graph

54 Commits

Author SHA1 Message Date
Tomas V.V.Cox
1910b18164 pgsql.php
* better handling of $rownum param in fetchInto()
* changed property numrows[] to num_rows[]

DB.php
* $rowmun in fetch* now defaults to NULL

mysql.php
* added default $fetchmode to ordered
* removed extra checks in connect()
* fetchrow() now uses fetchInto()
* added the "fetch absolute row numbers" feature to fetchInto()
(not tested)

ifx.php
* better handling of $rownum param in fetchInto()
2001-03-28 23:52:21 +00:00
Tomas V.V.Cox
88d526ec5b pgsql.php
* connect() always use pg_connect string instead of the deprecated params
mode
* removed duplicated functions prepare() and execute() (now in common.php)
* pgsqlRaiseError() always fills native error param on DB_error objs
* added third param $rownum to fetchInto() so users can fetch also absolute
row numbers
* changed fetchRow() to use fetchInto() (can not erase, still used in get*()
from common.php

DB.php
* added third param $rownum to fetchInto()/fetchRow() so users can fetch
also absolute row numbers
* changed fetchRow() to use fetchInto()
2001-03-26 23:31:49 +00:00
Stig Bakken
48aa99f6be * added Christian Stocker's tableInfo() implementation 2001-03-24 07:00:44 +00:00
Stig Bakken
4651aa04c0 * fixed Oracle tests, fixed some bugs in DB_oci8, all tests but
errorNative() pass now (but that may be a bug in the test :-)
* implemented numRows() emulation in DB_oci8 that is available
  in "optimize portability" mode only
2001-03-23 01:15:05 +00:00
Jon Parise
d4952b482e Style and whitespace, based mostly on a submission from
"Tomas V.V.Cox" <cox@idecnet.com>.
2001-03-21 04:15:40 +00:00
Jon Parise
cf48573277 Revised version of the parseDSN function.
Submitted by: "Tomas V.V.Cox" <cox@idecnet.com>
2001-03-11 23:26:18 +00:00
Stig Bakken
c685f25d33 * allow empty passwords in dsn (for example "mysql://user:@database") 2001-02-20 23:00:08 +00:00
Chuck Hagenbuch
0b11c910f5 All DB modules should return NULL from fetchRow() now if there are no more
results, and a DB_Error object only on an error.

DB::isError() return false when passed null now.
2001-02-16 17:14:39 +00:00
Colin Viebrock
2265b5b4c5 I think this should've been changed as well, right? 2001-02-02 17:59:30 +00:00
Chuck Hagenbuch
38fae9bae4 make sure to include subclasses before trying to instantiate them. 2001-02-02 05:24:31 +00:00
Stig Bakken
86c5a77ed9 @Allow url encoding in DB usernames and passwords (Stig, PEAR) 2001-01-30 08:34:55 +00:00
Chuck Hagenbuch
b4378dcf80 have DB::isError return true if passed "null". Now you can more consistently
use DB::isError(), since some of the db drivers return nulls from various
functions (like fetchRow()), and others don't... We should probably make all
of them just return errors. I did this for the mysql driver, as a start.
2001-01-26 20:07:22 +00:00
Stig Bakken
6792978aed * updated copyrights (thanks Colin)
* moved scripts to own directory (bug #7635)
2001-01-10 01:01:59 +00:00
Stig Bakken
9f0fc7db8b * DB::isManip counts "REPLACE" as a manipulation command (MySQL specific)
* renamed DB_common::execute_emulate_query to DB_common::executeEmulateQuery
* moved "query" DB method to DB_common, there was duplicated logic in query
  and simpleQuery in all backends.
2000-12-10 01:32:16 +00:00
Stig Bakken
efbc4a2566 * applied fetch modes patch for odbc by Richard M. Yumul
* added DB::isManip so we have _one_ place for testing whether something
  is a data manipulation query
* when passed a string as its first constructor arg, DB_Error now uses
  the error code DB_ERROR rather than just 0
* implemented auto-commit for ibase (not yet fully tested)
* fixed persistent connections in odbc
2000-12-08 02:30:43 +00:00
Stig Bakken
8f74a36858 * added Sebastian's affectedRows() and numRows() for MySQL
* added regression test for DB_mysql::affectedRows
* fixed some PEAR_Error based tests that had broken (line number change)
2000-12-07 19:53:27 +00:00
Stig Bakken
cc9d7fc744 * cleanup 2000-12-06 02:53:14 +00:00
Stig Bakken
48e7da206f * MySQL sequence emulation using auto_increment
* fixed indentation
2000-12-05 07:00:57 +00:00
Sebastian Bergmann
c20df37045 No comment. 2000-12-04 07:05:16 +00:00
Sebastian Bergmann
676bb6b9a0 I couldn't read it in order to understand it in order to extend it :-) 2000-12-04 06:56:29 +00:00
Stig Bakken
d004ea17c3 PEAR DB: added DB_ERROR_VALUE_COUNT_ON_ROW 2000-10-15 09:02:54 +00:00
Stig Bakken
be60fcb11a PEAR DB: added DB_ERROR_NOT_LOCKED, gave DB_common::raiseError an optional
"nativecode" parameter.
2000-10-15 02:22:25 +00:00
Stig Bakken
7c53e635b2 PEAR:
* added $debuginfo parameter to PEAR_Error constructor
 * put last query in $debuginfo from DB_common::raiseError()
@PEAR: add last executed query as debug info in DB errors (Stig)
2000-09-13 11:27:59 +00:00
Stig Bakken
f29b5131d3 @PEAR: renamed DB_GETMODE_* to DB_FETCHMODE_*, added setFetchMode()
@      in DB_common to set the default mode, added some MySQL tests (Stig)
2000-09-12 00:27:50 +00:00
Stig Bakken
54e911aa4f * renamed toString method to __string_value 2000-08-28 23:09:36 +00:00
Stig Bakken
315f4f5658 @PHP 3 regression testing framework re-born (Stig)
Took the old PHP 3 regression testing framework and rewrote it in PHP.
Should work on both Windows and UNIX, however I have not tested it on
Windows.  See tests/README for how to write tests.  Added the PHP 3
tests and converted most of them.
2000-08-27 19:46:06 +00:00
Sterling Hughes
3f97600862 Remove bogus commit that made DB::DB() an alias for DB::connect() 2000-08-24 18:18:49 +00:00
Sterling Hughes
4850e34bf3 -Add getCode() method to PEAR_Error
-Correct license versions + My Address for DB/* mods
-Correct ibase module
-Javadocize File_Find
-Add a optional constructor to DB that passes it on to DB::connect()
2000-08-24 01:34:16 +00:00
Chuck Hagenbuch
dc2362069e Make the DB classes work with call-time pass-by-reference disabled. 2000-08-21 14:37:47 +00:00
Stig Bakken
c63410f6be Multiple DB::connect or DB::factory calls using the same backend
should work now.
2000-07-26 09:57:06 +00:00
Stig Bakken
e0924de112 @Ported DB to new error reporting scheme 2000-07-24 08:24:14 +00:00
Stig Bakken
0f0f1cebcb * new class: PEAR - can be used as a base class for others.
* PEAR_Error moved into PEAR.php to reduce the number of files that are
  always included
* cleaned up the PEAR_Error API a bit and changed the two classes using it
* added PEAR_Installer - an administration class for installing packages
  and maintaining a "class/file cache"
2000-07-24 08:05:51 +00:00
David Croft
0836e10a15 various version 2.0 and 2.01 licenses -> 2.02 2000-07-24 05:41:02 +00:00
Chuck Hagenbuch
75879e3f18 i don't think there's a reason to nuke the db handle here (when freeing
results).
2000-07-02 19:04:36 +00:00
Chuck Hagenbuch
353dcc835f DB::parseDSN() now checks the value it is passed, and if it is already an
array, returns it. This lets you pass arrays to the connect functions and
they'll work transparently.
2000-06-30 19:20:03 +00:00
Chuck Hagenbuch
c80c71f48b Here is a brief start towards getting the DB stuff up to speed and working
(I need it to move forward on some stuff, and I really do want to see PEAR
succeed, so I'm going to work with the official code to get it working. Hope
that's okay). I've replaced all instances of 'use' and 'import' with
'include_once' (and added the .php extension where necessary). This gets my
short test script working. More possibly to come.
2000-06-21 02:22:04 +00:00
Stig Bakken
81ff62c271 PEAR now uses "use" instead of "include". 2000-03-09 21:57:14 +00:00
Stig Bakken
67cc918c3c Avoid E_NOTICE errors in PEAR code. 2000-02-27 14:46:27 +00:00
Stig Bakken
1170876974 add a note about include return values 2000-02-25 21:18:01 +00:00
Stig Bakken
64057e992b * prepare/execute emulation moved into DB_common
* returning references everywhere in DB_mysql and DB_pgsql
* added a todo note to DB_pgsql
2000-02-17 20:21:01 +00:00
Stig Bakken
475b31f1e0 @Added DB/storage to PEAR
@Introduced DB warnings
Added DB/storage to PEAR.
Introduced DB warnings
Revert to using Javadoc-style comments.
DB_common now returns references in the appropriate places
2000-02-14 15:12:20 +00:00
Andrei Zmievski
ab465c5857 Return by reference, where necessary. 2000-02-09 19:41:13 +00:00
Stig Bakken
338608ab31 Added three get modes: DB_GETMODE_ORDERED, DB_GETMODE_ASSOC and
DB_GETMODE_FLIPPED.  Docs are within.
2000-02-09 19:04:17 +00:00
Stig Bakken
a04a28fbb5 * Started playing around with alternatives to javadoc.
* Fixed the "make install" rule so it doesn't temporarily break the
  installed scripts.
* implemented prepare/execute emulation for MySQL including file-reference
  parameters (only binmode/binfetchlen remains now)
* started fixing up the ODBC backend
2000-02-03 10:49:03 +00:00
Sascha Schumann
43ae2bffbb Happy Y2K patch! Happy new year (or the new millennium, depending on whether
you start counting at 0 or 1).
2000-01-01 01:32:05 +00:00
Stig Bakken
f30278b96b - Documented classes, methods and constants in the source
- Defined DB_ERROR_NOSUCHTABLE and DB_ERROR_NOSUCHFIELD
- Renamed DB_common::capableOf to DB_common::provides
- Cleaned up the error code mapping
- Added simpleQuery method in DB_mysql
- Changed getXxx methods in DB_common to use simpleQuery
- Fixed bug in DB_common::getAssoc
1999-12-12 15:55:56 +00:00
Stig Bakken
208696f489 Added some more error defines (CANNOT_CREATE/DELETE/DROP).
Folded up the methods in DB.php.
Started adding documentation for DB_result methods.
Added doOne() doRow() and doAssoc() methods in DB_common.
Added numCols() to DB_mysql.
1999-12-08 13:49:09 +00:00
Andrei Zmievski
c2eae47a23 Oops. 1999-12-07 21:41:34 +00:00
Andrei Zmievski
44f6f66bd2 (DB::parseDSN) check for an extra / at the end purely to guard against
user error
1999-12-07 21:38:51 +00:00
Andrei Zmievski
9c89f731e8 (DB::parseDSN) Remove extraneous / at the end of the spec if no database
is specified.
1999-12-07 21:30:38 +00:00