Jump to content

Recommended Posts

Hello, I am attempting to use the PEAR::MDB2 package.  I have installed the MDB2 package (MDB2-2[1].1.0.tgz) and the MSSQL Driver (MDB2_Driver_mssql-1[1].1.0.tgz).  I execute the following code:

<?php
    require_once('MDB2.php');
    echo "THIS IS A SQL SERVER DATABASE TEST<BR>";

    $dsn = 'mssql://login:password@192.168.1.15/mydb';
 
    echo "CREATING INSTANCE<BR>";
    $mdb2 =& MDB2::factory($dsn);
    if (PEAR::isError($mdb2)) {
        echo "INSTANCE FAILED<BR>";
        die($mdb2->getMessage());
    }
    else
        echo "INSTANCE SUCCESSFUL<BR>";

    $query = 'SELECT * FROM Contact';
    echo "ATTEMPTING QUERY<BR>";
    $result =& $mdb2->query($query);  [b]//execution stops here![/b]
    // check if the query was executed properly
  if (PEAR::isError($result)) {
        echo "QUERY FAILED";
        die($result->getMessage());
    }
    else
        echo "QUERY SUCCESSFUL";
       
    $mdb2->disconnect();
?>

The output on screen is:

THIS IS A SQL SERVER DATABASE TEST
CREATING INSTANCE
INSTANCE SUCCESSFUL
ATTEMPTING QUERY

So execution is stopping at the indicated line, but I am not sure why I am not getting any errors returned.  Any help would be much appreciated.  Thanks!
Link to comment
https://forums.phpfreaks.com/topic/13756-pearmdb2-connection-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.