|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-09-20 08:59 UTC] m dot karoly at martondesign dot com
Description:
------------
The code i commented well, see below.
Short description:
When i try to make a SELECT, and get the rows, the odbc_fetch_rows, odbc_fetch_array, odbc_result_all returns FALSE.
The connection works, the schema, table, columnnames i can receive in php.
Platforms i tested:
Php 4.4.4 + Velocis (2.1) = Everythings work
Php 5.1.6 + Velocis (2.1) = Not working
Php 4.4.4 + Birdstep (6.0) = Not working
Php 5.1.6 + Birdstep (6.0) = Not working
Php 5.2.x-dev + Birdstep (6.0) = Not working
Reproduce code:
---------------
<?php
$conn = odbc_connect("RDS","username","password", SQL_CUR_USE_ODBC ); // When i connect to the dsn, everything is ok. (returns with a resource id)
$odbc_result = odbc_columns($conn); // When make a query to get the "schema.table name.column name". (returns with a resource id)
while (odbc_fetch_row($result)){ // in this case the odbc_fetch_row is working, but if i pass a odbc_exec return value as a parameter, it won't
echo"<br>".odbc_result($result,"TABLE_SCHEM").'.'.odbc_result($result,"TABLE_NAME").".".odbc_result($result,"COLUMN_NAME");
}
$odbc_result = odbc_exec($conn, "SELECT * FROM schema.table"); // When i make a query, it seems to be ok too. (returns with a resource id)
odbc_result_all($odbc_result); // but -as i mentioned above - if i fetch the result of an odbc_exec (or odbc_do) query, it returns with FALSE
// doesn't matter what fetch function i call, none of them returns data (odbc_fetch_array, odbc_fetch_row, odbc_result_all...)
?>
Expected result:
----------------
odbc_fetch_array: returns array
odbc_fetch_row: returns string
odbc_result_all: returns html table
Actual result:
--------------
odbc_fetch_array: returns false
odbc_fetch_row: returns false
odbc_result_all: returns false
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 13:00:01 2025 UTC |
<?php $conn = new PDO('odbc:RDS', 'user', 'pass'); $qp = $conn->prepare("select de_noteblob from user where rowid = 8598"); $qp->execute(); $results_array = $qp->fetchAll(PDO::FETCH_ASSOC); var_dump($results_array); ?> Expected: Lists an array: de_noteblob is a text de_noteblob = string(24) "Test string, test string" Actually results: Memory pieces with the exact length. de_noteblob = string(24) "????yx>><?php sd|rw4r45"