Questions tagged [mdb2]

A database abstraction layer for PHP.

At the time of this writing, the last stable version was released on 2007-05-03 and the last beta version on 2012-10-29.

A better alternative is –the native since PHP 5.1.0– PDO

PEAR MDB2 is a merge of the PEAR DB and Metabase php database abstraction layers.

It provides a common API for all support RDBMS.

Among other things MDB2 features:

  • An OO-style query API
  • A DSN (data source name) or array format for specifying database servers
  • Datatype abstraction and on demand datatype conversion
  • Portable error codes
  • Sequential and non sequential row fetching as well as bulk fetching
  • Ability to make buffered and unbuffered queries
  • Ordered array and associative array for the fetched rows
  • Prepare/execute (bind) emulation
  • Sequence emulation
  • Replace emulation
  • Limited Subselect emulation
  • Row limit support
  • Transactions support
  • Large Object support
  • Index/Unique support
  • Module Framework to load advanced functionality on demand
  • Table information interface
  • RDBMS management methods (creating, dropping, altering)
  • Full integration into the PEAR Framework
  • PHPDoc API documentation

Currently supported RDBMS:

  • MySQL
  • MySQLi (PHP5 only)
  • PostgreSQL
  • Oracle
  • Frontbase (unmaintained)
  • Querysim
  • Interbase/Firebird (PHP5 only)
  • MSSQL
  • SQLite
93 questions
1
vote
3 answers

source lines while debugging a core dump

In c or c++ While debugging a core dump,i.e., if we are left with a coredump file and try to debug using that core file is there a way we can see the last few lines of code before the dump occured.the stack trace only shows the function call. for…
Vijay
  • 65,327
  • 90
  • 227
  • 319
1
vote
0 answers

PEAR MDB2 seek() & count() in MDB2_Iterator

I am having trouble with MDB2_Iterator, this is an old project which is being moved to a new server. The function in MDB2_Iterator for count() is below: public function count() { if ($this->result) { return $this->result->numRows(); …
Jake N
  • 10,535
  • 11
  • 66
  • 112
1
vote
1 answer

External database access in Wordpress plugin

I have developped a small Wordpress plugin that filter the page content setup thru a add_filter('the_content'...) call. My filtering function does include PHP files that makes external database calls thru the use of Pear MDB2 classes, it appears…
JS_
  • 61
  • 2
  • 7
1
vote
1 answer

How to make several tests using MDB2 with PHPUnit DataBase?

I use PHPUnit DataBase to test some class using MDB2. All is well, since I encounter the second test, which returns an error: Caught exception: Object of class MDB2_Error could not be converted to string When I place the second test in place…
H_I
  • 385
  • 3
  • 8
1
vote
0 answers

How to set a foreign key?

I am doing a project which is using MDB2 implementation. I wanna to set a foreign key on xml schema file. There are only 3 tables: student, course, and enrollment where enrollment is serve as a bridge entity. Here is my xml file for…
Js Lim
  • 3,625
  • 6
  • 42
  • 80
1
vote
2 answers

how to get SQL generated by Pear MDB2 without executing it?

I'm working with Pear MDB2 with PHP 5.3. I'm coding a project that updates a DB and before I let it start changing data, I'd like to see what the SQL queries generated by autoPrepare() and execute() look like before actually executing them. I plan…
Mr. Lance E Sloan
  • 3,297
  • 5
  • 35
  • 50
1
vote
1 answer

Are there any real advantages to upgrading to PEAR::MDB2 from PEAR::DB?

We have a very large legacy codebase and I was wondering if there's any REAL advantage to upgrading to MDB2. Thoughts? Speed? Readability? Fewer bugs? Anything at all? Thanks
Shamoon
  • 41,293
  • 91
  • 306
  • 570
1
vote
1 answer

Im getting MDB2 Error: not found

Im tryng to test a website on my computer as localhost, I got the original website files and sql file for database. Im using Ubuntu Client 16.04, I have installed PHP7,MYSQL,Pearl,MDB2. Im using connection like this `require_once 'PEAR.php'; …
Somepub
  • 445
  • 2
  • 6
  • 22
1
vote
1 answer

DB2 audit performance impact

Client requested to audit all user SQL statements to check who is accessing the data. We are going to implement `execute' audit policy. How much it will impact performance of the database??
Masheed
  • 13
  • 4
1
vote
1 answer

Cannot connect to MySQL Database with MDB2 (Error not Found)

In first point. I am absolutely a noob in PHP and PEAR. For exercising I have worked with PHP, Pear and Mondial DB of Oracle offline, but now I wanted to connect to my Database on 1and1.com. Following I have tried: $dsn =…
Buzz
  • 315
  • 6
  • 18
1
vote
1 answer

PHP Pear missing 'MDB2.php'

Once this website is moved to another server, I'm getting the following error: Fatal error: require_once(): Failed opening required 'MDB2.php' (include_path='.:/usr/lib/php5.4:/usr/lib/php5.4/') in …
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
1
vote
1 answer

How to use PHP with MSSQL (PEAR MDB2?)

I've spent about half of my day trying to figure out how to get PEAR MDB2 to work with MSSQL. I've gotten to the point where I'm missing php_mssql.dll. No idea where to find it or how to get it. What I'm wondering is if anybody can explain, from…
Andrew
  • 1,571
  • 17
  • 31
1
vote
0 answers

Return error when data type doesn't match submitted data (MDB2 prepare/execute)

If I pass the following data to MDB2, execute does not return an error. It converts the invalid text to a zero and inserts anyway. $types = array('integer','integer','integer'); $data = array( 'reviewid' => 123, 'userid' =>…
a coder
  • 7,530
  • 20
  • 84
  • 131
1
vote
1 answer

MDB2 prepared statements and inserting NOW()

I'm working with MDB2's prepared statements and am a little confused with the documentation, specifically dealing with MySQL built-in functions like NOW() or CURDATE(). The values passed in $data must be literals. Do not submit SQL functions (for…
a coder
  • 7,530
  • 20
  • 84
  • 131
1
vote
1 answer

mdb2 prepare statement with multiple types

I'm using PHP 5.1.6 and MDB2 and trying to wrap my prepare/execute/fetchAll into a class so I can execute a select query with one line. The following code shows the Class that I've created and also doing the same query directly:
Rob Gale
  • 325
  • 1
  • 9