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
0 answers

How to handle RunTimeExceptions in MDB control before going to onMessage()

I was written a simple MessageListener(MDB) it is working fine.How to handle runtime exceptions in this. [Ex: if was try to deploy this listener with a wrong queue name like "XXXX" instead of right one that time it is showing Exceptions and…
veeras
  • 61
  • 1
  • 4
  • 11
0
votes
1 answer

Best way to tie MDB with JMS destination

I have a Message Driven Bean @MessageDriven(ejbName = "TestMDB", destinationJndiName="test.QueueIn", destinationType = "javax.jms.Queue") public class TestMDB extends GenericMessageDrivenBean implements MessageDrivenBean, MessageListener { …
xarx
  • 627
  • 1
  • 11
  • 27
0
votes
1 answer

PHP: Using quote() on strings in MDB2 with MYSQL

I'm using Pear's MDB2 and really enjoying it, but there is something that is starting to annoy me. I build the SQL string in the following way, using the quote method of the mdb2 package: $sql = sprintf("INSERT INTO profiles(email, fullName)…
Leif Denby
0
votes
1 answer

isError and factory method in PDO?

Do we have a similar kind of methods in PHP PDO too??? We have a isError() and factory methods in Pear mdb2. PEAR::isError($result) MDB2::factory Do we have a similar kind of methods in PHP PDO too???
Subash
  • 165
  • 2
  • 3
  • 13
0
votes
1 answer

Insert blob data into mysql using MDB2 in php

Can anybody help me to insert blob data in Mysql using MDB2 through php ? I want to insert file into database using MDB2. MBD2 setup is works fine.
Chintan
  • 59
  • 1
  • 8
0
votes
1 answer

PEAR MDB2 executeStoredProc and returning a result set. Possible? Worth it?

I've been trying to make this work for the last couple of hours. I have a simple stored proc called get_log_entries: CREATE DEFINER=`root`@`localhost` PROCEDURE `get_log_entries`(p_min_id INT) BEGIN SET p_min_id = IFNULL(p_min_id, -1); SELECT *…
MK_Dev
  • 3,291
  • 5
  • 27
  • 45
0
votes
2 answers

mdb2 error with integer = NULL in prepare statement

I have an annoying problem with mdb2 while trying to insert empty values in an integer field. $query = $conn->prepare("INSERT INTO enquiries (type, idvenue, cname, fname, lname, phone, email, date, guests, budget, comments) VALUES (:party,…
Javi Prieto
  • 429
  • 3
  • 14
0
votes
1 answer

Advantages of using MDB2 over straight database functions like mysql_query?

What are the advantages (and disadvantages) of using the Object-Oriented database library MDB2 over the straight database functions that come with PHP?
user9903
0
votes
1 answer

MDB2/MySQL, multiple connections

I have a script that for the most part interacts with one mysql database. However, when a certain function is called, I am now wanting to do an if{} and in the case of true connect to another mysql database and update a table. After this, other…
gio
  • 991
  • 3
  • 12
  • 24
0
votes
1 answer

MDB2 disconnects and forgets charset setting when reconnecting

We recently debugged a strange bug. A solution was found, but the solution is not entirely satisfactory. We use IntSmarty to localize our website, and store the localized strings in a database using our own wrapper. In its destructor, IntSmarty…
Vegard Larsen
  • 12,827
  • 14
  • 59
  • 102
0
votes
1 answer

MDB2 quotes -- null values?

According to the PEAR MDB2 documentation, I can optionally quote or not quote values using the third parameter: $mdb2->quote($val1, "text", true) $mdb2->quote($val2, "integer", false) Is there a way to enable conversion of blank values to NULL? Ie,…
a coder
  • 7,530
  • 20
  • 84
  • 131
0
votes
2 answers

>Call to a member function exec() on a non-object< when I try to call PEAR MDB2 class

I have a problem which I seem unable to solve on my own, although the script is kind of simple... I simply want to write sth. in a MySQL database (auto_increment id) with the following script:
0
votes
1 answer

how to include "order by" in Pear MDB2 autoexecute select statments

I'm using Pear MDB2's "Extended" module to have it automatically generate and execute SQL select statements. The help document is here: http://pear.php.net/manual/en/package.database.mdb2.intro-auto.php I want to get the results back from the DB in…
Mr. Lance E Sloan
  • 3,297
  • 5
  • 35
  • 50
0
votes
1 answer

Turn off logging of PHP MDB2 notices?

We recently upgraded from PHP 5 to 7.4, and out Pear MBD2 package is spamming our Apache2 log with a bunch of ridiculous notices. PHP Notice: A non well formed numeric value encountered in /usr/share/php/MDB2/Driver/mysqli.php on line 1154,…
Powermaster Prime
  • 402
  • 1
  • 2
  • 16
0
votes
2 answers

Making SQL calls from inside a function

I've got a PHP function (call it funcA) that is used in multiple places, so I placed funcA (and some related functions) in a separate file that is required in other PHP files. funcA makes numerous queries on a database that is already open and used…
Jonathan M
  • 17,145
  • 9
  • 58
  • 91