phpmysqlpearmdb2

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';
    PEAR::setErrorHandling(PEAR_ERROR_DIE);
    require_once("MDB2.php");

    $dburl = "mysql://####################################";
    $ib = MDB2::factory($dburl);
    unset($dburl);

    $ib->setFetchMode(MDB2_FETCHMODE_ASSOC);
    if(PEAR::isError($ib)) throw new Exception("Viga andmebaasi ühendamisel: " . $ib->getMessage()); ?>

    `  

When i try to fetch data from index.php

`

require_once 'db.php';

if  (isset($_GET["s"])) $sort=" ...SQL...; else $sort="...SQL...";

$sql="...SQL...".$sort; //." limit 1";

$rs=$ib->query($sql);
if (PEAR::isError($rs)) die($rs->getMessage());
`

But I get an error MDB2 Error: not found.


Solution

  • The problem was that I used php7. When I downgraded to php 5.6 and reinstalled pear, mdb2 driver and mdb2 mysql driver all worked fine!