Re: [PHP-DB] pdo_odbc and odbc

2007-01-03 Thread Chris

james tanhs wrote:

Hi,
I m running on :
client: XP + Apache2.2+Php5.2 ( enabled pdo, pdo_odbc, Merant)
server: oracle8i
Are there anyone having the same problem ?


Maybe ask the php-general list since you haven't got a reply here.. 
there are more people on that list and more chances that someone will 
have a suggestion about what's going on.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] pdo_odbc and odbc

2006-12-29 Thread james tanhs

Hi,
I m running on :
client: XP + Apache2.2+Php5.2 ( enabled pdo, pdo_odbc, Merant)
server: oracle8i
Are there anyone having the same problem ?
Thanks.

?php

// option 1
$db = new PDO('odbc:his', 'his', 'passwd');
$db-setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $db-prepare(select name from his_cust_mst where mrn = ?);
$stmt-bindValue(1, '003568', PDO::PARAM_STR);
try {
  $stmt-execute();
 while ($row = $stmt-fetch()) {
  print_r($row);
 }
} catch (PDOException $e) {
  echo Syntax Error: .$e-getMessage();
}

// option 2
$Connection = odbc_connect(his,his,passwd);
$stmt = odbc_prepare($Connection, select name from his_cust_mst where
mrn=?);
$res = odbc_execute($stmt, array('003568'));
if($res) $row = odbc_fetch_array($stmt);
print_r($row);


Errors:

Option1
Syntax Error: SQLSTATE[HY000]: General error: 3129 [MERANT][ODBC Oracle 8
driver][Oracle 8]ORA-03129: the next piece to be inserted is required
(SQLExecute[3129] at ext\pdo_odbc\odbc_stmt.c:133)

Option2
Warning: odbc_execute() [function.odbc-execute]: SQL error: [MERANT][ODBC
Oracle 8 driver][Oracle 8]ORA-01008: not all variables bound , SQL state
S1000 in SQLExecute in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\hnet\testodbc.php on line 30


?