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
0
votes
1 answer

Warnings while installing PEAR modules, no results

Running IIS 6, fastCGI, PHP 5.3.6 with PEAR MDB2. I've installed this setup multiple times with no problem, but as of a couple of days ago when newly installing PHP on servers (this happened on more than one), I get to the point of installing the…
Jonathan M
  • 17,145
  • 9
  • 58
  • 91
0
votes
1 answer

Error with cpanel migrated account (PEAR/MDB2)

I had a site in a cpanel server working well but when I have migrated it to a new one, I have a MDB2 error related. Fatal error: Call to a member function tableInfo() on a non-object in /home/lubrican/public_html/clientes/PEAR/MDB2.php on line…
Roberto P
  • 1
  • 1
0
votes
1 answer

MDB2 placeholder shorthand with DB->query

I just realized that the pear:DB extension is deprecated and I'm working on updating some scripts to MDB2. I'm a little disappointed how cumbersome the placeholder arrangement is. Am I missing something? Is there a shorthand available that is…
starsinmypockets
  • 2,264
  • 4
  • 34
  • 45
0
votes
5 answers

Which should I use, pear MDB2 or pear DB_DataObject when I use MySQL when I can not use PDO?

Almost all of free web hosting server, you can not use PDO + MySQL. They lack PDO drivers. So I am considering to select pear MDB2, or DB_DataObject. Which do you reccomend to me? Give me your opinions!
troll
0
votes
2 answers

What do I need to do, if anything, to ensure $mdb2->lastInsertID() returns the auto-increment value for that connection?

I've made the switch recently from SQL Server to MySQL, and I can't find a solid enough answer to this question anywhere: I'm using PHP, MySQL, and the InnoDB table engine on the tables I need to lock. So for a standard series of 3…
jspivack
  • 51
  • 1
  • 5
0
votes
1 answer

how to select specific field from a database using mdb2 php?

I'm trying to select a specific ID that is auto-generated by the oracle database for a specific session user(from log in and its working fine). I'm using MDB2 to achieve this. I am following the pear: MDB2 manual and did the codes the way it is but…
Emi
  • 1
  • 3
0
votes
0 answers

Mssql is not compiled into PHP

I have pear and mssql installed on my ubuntu server 16.04, but while connecting it shows an error message [Error message: extension mssql is not compiled into PHP] Can anybody, please, help me avoid that error?
0
votes
1 answer

Why an EXPLAIN statement is generated when doing a simple query?

I am using MDB2 to make query to my MySQL database but when I query the database, the MySQL log trace 2 statements: the first one is an explain statement and the second is my query. Here is the code: $sql = "SELECT 1 FROM DUAL"; $mdb2Instance = new…
Alban Soupper
  • 671
  • 1
  • 5
  • 20
0
votes
0 answers

MDB2: Unable to bind to missing placeholder

I am trying to use Pear MDB2 object in order to execute a query against my database, but it isn't working. Instead I am receiving an error Unable to bind to missing placeholder on the execute(). I have a sql builder function, which returns a sql…
Lamar
  • 7
  • 6
0
votes
1 answer

Xampp/Php: extension mysql is not compiled into Php

"extension mysql is not compiled into Php" is an error i keep receiving. Throughout research I have found that the mysql.dll is no longer used in the version of xampp i have. I am using PEAR and an array $dsn. Now I do see that an pdo_mysql.dll is…
Kevlwig
  • 133
  • 2
  • 11
0
votes
0 answers

PHP MDB2: Creating MDB2 singleton connection within an object

I am new to Php OOP and I doing research I read that the singleton design for database objects are the preferred method. However, I am lost as to whether this will continue to make new instances of that connection, since I am not directly creating…
Kevlwig
  • 133
  • 2
  • 11
0
votes
2 answers

Character encoding issues: MySQL 5.0 + PHP 5.2

I have a MySQL database with an InnoDB table containning utf8_general_ci varchar fields. When I fetch them through PHP (via PEAR::MDB2) and try to output them (via Smarty), I get ??? symbols. I would like to know how to fix that problem, which is…
Mathieu M-Gosselin
  • 1,225
  • 1
  • 13
  • 17
0
votes
2 answers

Change the Format of Input for a date from Y/M/D to D/M/Y in SQL/PHP from a form

I need to be able to change the date format from Y/M/D to D/M/Y. The database with all the data that I am querying has the date set as Y/M/D whereas the input form has the input yet as D/M/Y. Does anyone have any idea how I can change the…
RealHelper
  • 67
  • 8
0
votes
1 answer

Modifying a class to encapsulate instead of inherit

The codebase I've been handed to work with features a databse class that inherits from MDB2. This forms the basis for the MVC framework in use (a custom built affair) and the models in turn inherit from db. As I'm sure some of you have noticed, this…
GordonM
  • 31,179
  • 15
  • 87
  • 129
0
votes
1 answer

MDB2 autoprepare problem

I am using mdb2 for my website and i ran into a problem. I have an order_no field in my table that i would like to have a default value like LAST_INSERT_ID() + 1. Is there a datatype that can be set for this kind of mysql functions for…
Andrei
  • 117
  • 1
  • 1
  • 9