Bug #13783 Updated: odbc_fetch_into different issue
| From: | ahill@php.net | Date: | Tue, 23 Oct 2001 14:10:48 +0000 |
| Subject: | Bug #13783 Updated: odbc_fetch_into different issue | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68820@lists.php.net to get a copy of this message | ||
ID: 13783
Updated by: ahill
Reported By: Grant.Walters@walters.co.nz
Old Status: Open
Status: Analyzed
Bug Type: ODBC related
Operating System: SCO Openserver 5.0.5 & RH Lnux 7
PHP Version: 4.0.6
Old Assigned To:
Assigned To: ahill
Previous Comments:
------------------------------------------------------------------------
[2001-10-22 20:59:00] Grant.Walters@walters.co.nz
No errors at all, just returns an empty recordset.
One probably important note. When I compiled PHP 4.0.6 I had to remove the reference to isql.h? in
the php_odbc source program as it wasn't in the Openlink SDK for Openlink 4.1.
Everything seems to work except the selected record stuff which hasn't ever worked for me using
PHP 4 against Openlink.
I think I had it working under PHP 3.0.15 against Openlink 3.2, but we have moved on since then.
------------------------------------------------------------------------
[2001-10-22 20:56:36] Grant.Walters@walters.co.nz
Using odbc_fetch_into($id, $number, $result_array);
SQLAllocHandle ( ... )
SQL_SUCCESS
SQLSetStmtAttr ( ... )
SQL_SUCCESS
SQLAllocHandle ( ... )
SQL_SUCCESS
SQLDriverConnect ( ... )
SQL_SUCCESS
SQLGetInfo ( ... )
SQL_SUCCESS
SQLGetInfo ( ... )
SQL_SUCCESS
SQLAllocHandle ( ... )
SQL_SUCCESS
SQLGetStmtAttr ( ... )
SQL_SUCCESS
SQLGetStmtAttr ( ... )
SQL_SUCCESS
SQLGetStmtAttr ( ... )
SQL_SUCCESS
SQLGetStmtAttr ( ... )
SQL_SUCCESS
SQLGetInfo ( ... )
SQL_SUCCESS
SQLSetStmtAttr ( ... )
SQL_SUCCESS
SQLExecDirect ( ... )
SQL_SUCCESS
SQLNumResultCols ( ... )
SQL_SUCCESS
SQLNumResultCols ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLBindCol ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLBindCol ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLBindCol ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLBindCol ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLBindCol ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLBindCol ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLColAttribute ( ... )
SQL_SUCCESS
SQLBindCol ( ... )
SQL_SUCCESS
SQLExtendedFetch ( ... )
SQL_SUCCESS
SQLExtendedFetch ( ... )
SQL_ERROR
SQLFreeHandle ( ... )
SQL_SUCCESS
SQLDisconnect ( ... )
SQL_SUCCESS
SQLFreeHandle ( ... )
SQL_SUCCESS
SQLFreeHandle ( ... )
SQL_SUCCESS
------------------------------------------------------------------------
[2001-10-22 10:31:58] jpm@php.net
Status -> Feedback
------------------------------------------------------------------------
[2001-10-22 09:38:15] ahill@php.net
Are you getting error messages?
Also, please generate an odbc trace; uncomment the DebugFile section in odbc.ini.
Best regards,
Andrew Hill
OpenLink Software
------------------------------------------------------------------------
[2001-10-21 20:59:21] Grant.Walters@walters.co.nz
Platforms:
Using PHP 4.0.6/Openlink 4.1/Progress 8.3D.
Other:
I've tried PHP 4.0.4/4.0.5/4.0.6, Openlink 3.2,4.0,4.1, Progress 8.3C,8.3D,9.1C, shared memory
and TCP/IP based connections.
Problem:
Doesn't seem to matter what I do, I am completely unable to select specific rows using ODBC.
I think the code below is correct, it's snipped from scripts.
<?
$dsn="DSN=$database;UID=$user;PWD=$password";
// I've tried all these without a difference.
$cursor="SQL_CUR_USE_ODBC";
//$cursor="SQL_CUR_IF_NEEDED";
//$cursor="SQL_CUR_USE_DRIVER";
//$cursor="SQL_CUR_DEFAULT";
$sql="SELECT * FROM user_table";
$text="";
function db_fetch_into($id, $number) {
global $text;
$text = "<TD>ROW: $number</TD>";
//Never Returns Anything
//odbc_fetch_into($id, $number, $result_array);
//Always Works
odbc_fetch_into($id, $result_array);
//Always Works
//odbc_fetch_into($id, 0, $result_array);
return $result_array;
}
if ($conn=odbc_connect("$dsn","","","$cursor")){
echo "<TABLE border='1'>";
//while ((odbc_fetch_into($results,$pos,$row)) && ($count<$limit)) {
$pos=0;
while ((list($var1,$var2) = db_fetch_into($result, $pos)) && ($pos<10)) {
echo "<TR>$text<TD>$var1</TD><TD>$var2</TD></TR>";
$pos ++;
}
echo "</TABLE>";
odbc_free_result($result);
odbc_close($conn);
} else {
// No connection .....
}
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13783&edit=1