Reply to Help with DB::execute please?

Your name:

Reply:


Posted by M on 07/12/05 17:23

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(access)://tcp()driver=Microsoft Access Driver
(*.mdb);dbq=C:\\PrjData\\TestScripts\\TestScript.mdb";
$conn = DB::connect ($dsn);
if (DB::isError ($conn))
die ("Cannot connect: " . $conn->getMessage () . "\n");

$updateQuery="UPDATE Book1 SET SubCategory = ? WHERE ID = ?;";
$sth = $conn->prepare($updateQuery);
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>";

?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация