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
10
votes
7 answers

Replacement for PEAR: MDB2 on PHP 5.3

I've been using pear packages in php for years. I'm in the process of upgrading/moving a sites that uses the MDB2 pear package and it has not been updated for PHP 5.3.X. In 5.3, MDB2 is returning those new annoying errors. Unknown: Assigning the…
mattweg
  • 1,170
  • 3
  • 9
  • 14
4
votes
1 answer

Do MySQL prepared queries provide a performance benefit for once-per-session queries?

According to the documentation, a prepared query provides a significant performance benefit if you're running a query multiple times because the overhead of the MySQL server parsing the query only happens once. I'm wondering what exactly they mean…
allanc
  • 43
  • 3
3
votes
2 answers

Error installing MDB2 under Pear

I am trying to install pear's mdb2 package so I can use mail queue. I enter the following command and get the error below. Any suggestions? C:\wamp\bin\php\php5.3.4>pear install MDB2 No releases available for package "pear.php.net/MDB2" install…
christian
  • 2,279
  • 4
  • 31
  • 42
3
votes
4 answers

Preventing SQL injection in PHP with MDB2

I'm trying to figure out how to prevent sqlinjection, I wrote this basic function : function antiInjectie($inputfromform){ $temp = str_replace("'", "`",$inputfromform); $temp = str_replace("--", "~~",$temp); return…
Lucas Kauffman
  • 6,789
  • 15
  • 60
  • 86
3
votes
0 answers

PHP Fatal error: Uncaught MDB2 Error: unknown error Code: -1\n

I am trying to get our old script working again. Foreword; we are using a custom written/modified script from someone who passed away. We cannot use something else. The script runs on the old server, but the server is really getting outdated so I am…
Joanne
  • 514
  • 3
  • 8
  • 30
3
votes
1 answer

Getting MDB2 to work with sqlite3 via pdo

I am using MDB2_Driver_pdoSqlite to access a sqlite3 database with PEAR. I am able to connect to the database and display a list of tables with listTables(), but when I try to run the mdb2 function tableInfo() I get an error. MDB2 Error: not found…
reubano
  • 5,087
  • 1
  • 42
  • 41
3
votes
1 answer

how to use MDB2

I am trying to use MDB2.php. I have downloaded XAMPP with the PHP 5.4 version. I understand that, in order to use MDB2, I need to include it in my PHP file. This is how I am doing it: My createTable.php file its in C:\Users\Lexy…
Lexy Feito
  • 280
  • 1
  • 8
  • 19
2
votes
1 answer

Fatal error memory owing to being exhausted at runtime

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 51 bytes) in C:\xampp\htdocs\project\App\library\PEAR\MDB2\Driver\mysql.php on line 1160 I have a large DB (1.5GB) and I come up with that error when I am trying…
Kingston Town
  • 63
  • 1
  • 9
2
votes
2 answers

Connecting to MS SQL from PHP on IIS using PEAR MDB2

Sorry to have to ask this here; php.net just seems to be full of exceptions and excuses regarding this. I'm running IIS 6.0 with PHP 5.3.6. I've got MDB2 installed and working (even with a custom-written driver for an off-brand RDBMS). That's all…
Jonathan M
  • 17,145
  • 9
  • 58
  • 91
2
votes
1 answer

Connecting to MDB2 in PHP object

$dsn="mysql://$db_username:$db_password@$db_hostname/$db_database"; global $mdb2; $mdb2=MDB2::connect($dsn); if (PEAR::isError($mdb2)) { die($mdb2->getMessage()); } I do this to connect to my DB, I put this in a separate php file called…
William Sham
  • 12,849
  • 11
  • 50
  • 67
2
votes
1 answer

how to debug the cause of problem using pear mdb2

2, 'result_buffering' => false, ); $mdb2 =& MDB2::singleton($dsn, $options); if (PEAR::isError($mdb2)) { …
Khurram Ijaz
  • 1,844
  • 5
  • 24
  • 43
2
votes
0 answers

raspberry pi and nayax device payment gateway communication using usb port of raspberry pi3

for my project of vending machine using raspberry pi .I need to connect raspberry pi with nayax payment device which is based on marshall protocol .The connection between raspberry pi and nayax device is using ttyUSB0 port. nayax device programming…
2
votes
1 answer

PHP: MDB2 error - call to undefined function

I have error in my old project based od MDB2 and PHP 5.4: PHP Fatal error: Call to undefined function: MDB2_Driver_pgsql::raiseError(). in /path/to/project/vendor/pear-pear.php.net/MDB2/MDB2.php on line 1936 Dependencies loaded via…
Marcin Zaremba
  • 253
  • 1
  • 3
  • 11
2
votes
2 answers

How to create Pear MDB2 sqlsrv connection for windows sql azure?

I want to connect with windows sql azure database using PEAR MDB2 sqlsrv driver. I can able to connect non federated database using this sqlsrv://username@server:password@server.database.windows.net:1433/mydatabase but with federated database I…
DEVOPS
  • 18,190
  • 34
  • 95
  • 118
2
votes
1 answer

Pear::MDB2 - get last executed query

I have to use Pear MDB2 but don't know how to get the last executed query. Is there a way to do that? Thanks,
Andreas
  • 5,305
  • 4
  • 41
  • 60
1
2 3 4 5 6 7