1

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.

Somepub
  • 445
  • 2
  • 6
  • 22

1 Answers1

0

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!

Somepub
  • 445
  • 2
  • 6
  • 22
  • Could you share what the problem was, and how you solved it? – Pistos Mar 13 '17 at 02:28
  • 2
    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! – Somepub Mar 13 '17 at 07:23
  • Great, thanks. I'm actually thought of the same thing. You should Edit your answer to include this information. – Pistos Mar 13 '17 at 11:50