#38310 [Opn->Fbk]: odbc_fetch_row(): 8 is not a valid ODBC result resource
| From: | jani@php.net | Date: | Tue, 24 Jul 2007 15:30:50 +0000 |
| Subject: | #38310 [Opn->Fbk]: odbc_fetch_row(): 8 is not a valid ODBC result resource | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115406@lists.php.net to get a copy of this message | ||
ID: 38310
Updated by: jani@php.net
Reported By: suneelpro at rediffmail dot com
-Status: Open
+Status: Feedback
Bug Type: ODBC related
Operating System: windows
PHP Version: 5.1.4
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
And use the PDO ODBC instead, it has been reported to work much better.
Previous Comments:
------------------------------------------------------------------------
[2006-08-03 10:05:16] suneelpro at rediffmail dot com
Description:
------------
pls provide source code for connection to access and display the
desired information (selecting of fields )in php.
Reproduce code:
---------------
function getListofPersonalDet()
{$connect = odbc_connect("msaccess","root","root") or
die("Couldn't
connect to datasource.");
echo $query = "select * from personal_details";
$result = odbc_prepare($connect,$query);
odbc_execute($result);
odbc_result_all($result,"border=1");
odbc_free_result($result);
while (odbc_fetch_row($result)) {
for ($y = 1; $y <= odbc_num_fields($result); $y++) {
$arr[$x][$y] = odbc_result($result,$y);
$x++;
}
if ($x > 1)
return $arr;
}
$arr=$result;
echo $arr[1][1];
}
Expected result:
----------------
array list of information framed in html using php
Actual result:
--------------
Warning: odbc_fetch_row(): 8 is not a valid ODBC result resource
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38310&edit=1