Help with DB::execute please?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M

    Help with DB::execute please?

    Hi Folks,

    I don't seem to be able to get DB::execute to work using an ODBC
    datasource and a MS-Access Database.

    Can anyone tell me if I am doing something wrong, or is there a bug in
    the DB class?

    Code fragment is below.

    Regards,

    Martin

    <?php
    require_once "DB.php";

    $dsn ="odbc(acces s)://tcp()driver=Mic rosoft Access Driver
    (*.mdb);dbq=C:\ \PrjData\\TestS cripts\\TestScr ipt.mdb";
    $conn = DB::connect ($dsn);
    if (DB::isError ($conn))
    die ("Cannot connect: " . $conn->getMessage () . "\n");

    $updateQuery="U PDATE Book1 SET SubCategory = ? WHERE ID = ?;";
    $sth = $conn->prepare($updat eQuery);
    if (PEAR::isError( $sth))
    {
    die($sth->getMessage() );
    }

    echo "<br> Prepare OK <br>";

    $data = array('1','1');
    //print_r($data);
    $res1 =& $conn->execute($sth , $data);
    if (PEAR::isError( $res1))
    {
    die($res1->getMessage() );
    }

    echo "Update OK <br>";

    ?>



  • Andy Hassall

    #2
    Re: Help with DB::execute please?

    On Tue, 12 Jul 2005 14:23:07 GMT, "M" <ihatespam.0.a1 01888@spamgourm et.com>
    wrote:
    [color=blue]
    > I don't seem to be able to get DB::execute to work using an ODBC
    >datasource and a MS-Access Database.
    >
    > Can anyone tell me if I am doing something wrong, or is there a bug in
    >the DB class?
    >
    > Code fragment is below.[/color]

    But no error messages posted... what seems to be the problem?

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    Working...