php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42127 Getting data from ODBC connection to progress using MERANT (DataDirect 4.0)
Submitted: 2007-07-27 15:15 UTC Modified: 2007-08-10 13:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hbouslama at edison dot ca Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 5.2.3 OS: Win 2000
Private report: No CVE-ID: None
 [2007-07-27 15:15 UTC] hbouslama at edison dot ca
Description:
------------
Hi every body,
I'm using PHP 5.2.3=>ODBC System DSN=>DataDirect 4.0=>Network Client for Progress 91.E and finaly Apache2. 
All are installed on Win2000 and Progress on Unix

I succeed connecting to the ODBC DSN and I can display filds names
but I can't receive data, the number of rows received is 0
I tried displaying data using other tools like Aqua data studio, RazorSql, Excel and Open Office all is going well. but not with PHP

I tried also to connect to a MySql database using ODBC and it works correctly

In the error log there's no error reported


Thank you for your time and effort



Reproduce code:
---------------
$DBCon = &ADONewConnection(SQL_DRIVER);
$DBCon->PConnect(SQL_HOSTNAME,SQL_USERNAME,SQL_PASSWORD,SQL_DATABASE) or die(' CONNECTION ERROR : '.odbc_errormsg());
if($DBCon)
 echo '<br>Connection established successfully';
$sql = 'SELECT CD_CIE, CD_SUCC FROM ACINTEL';
$result = $DBCon->Execute($sql);
if($result){
	echo '<br>Resultset is ok'.odbc_errormsg();
	echo '<br>Row count = '.$result->RowCount().".<br>";	
	echo '<br>Field count = '.$result->FieldCount().".<br>";	
	for ($i=0;$i<$result->FieldCount();$i++){
		$objField = $result->FetchField($i);
		echo "Field no $i = ". $objField->name."<br>";
	}
	echo 'Data : <br><pre>';
	while ($arr = $result->FetchRow()) {
		echo '<br>';
		print_r($arr);
	}
}

Expected result:
----------------
Connection established successfully
Resultset is ok
Row count = 3.

Field count = 2.
Field no 0 = CD_CIE
Field no 1 = CD_SUCC
Data : 
Array(
  [0]=>Array(
         [CD_CIE]=>Value1
         [CD_SUCC]=>Value2
       )
  [1]=>Array(
         [CD_CIE]=>Value3
         [CD_SUCC]=>Value4
       )
  [2]=>Array(
         [CD_CIE]=>Value5
         [CD_SUCC]=>Value6
       )
)

Actual result:
--------------
Connection established successfully
Resultset is ok
Row count = 0.

Field count = 2.
Field no 0 = CD_CIE
Field no 1 = CD_SUCC
Data : 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-30 22:35 UTC] hbouslama at edison dot ca
Hi,
I called a technical support of DataDirect and they asked me if php is compatible with SQL89
So I transfer the question to you guys ;-)

Could any body answer me please?

Hichem
 [2007-08-01 12:00 UTC] jani@php.net
Please try using the PDO ODBC instead, it should work better.
 [2007-08-01 14:36 UTC] hbouslama at edison dot ca
Hi
I didn't find the driver PDO ODBC in  adodb/drivers/

I tried :
$DBCon = &ADONewConnection('pdo');
$DBCon->PConnect('MyDSN_name', 'MyUser', 'MyPass', 'MyDatabase_Name');

And it generates an Error !
 [2007-08-01 14:38 UTC] hbouslama at edison dot ca
No Error was displayed but a white screan
 [2007-08-10 13:09 UTC] jani@php.net
This isn't any adodb support site. Please report bugs in it to the authors of it..
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Feb 29 01:01:29 2020 UTC