|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-17 04:43 UTC] Eric at juhaynum dot com dot br
[2009-06-06 12:52 UTC] rmbaba at gmail dot com
[2015-04-11 14:35 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2015-04-11 14:35 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 02:00:01 2025 UTC |
Description: ------------ Hello, I just prepared the server, installed apache, php5 mysql and odbc, I configured the the required files as well , and here is the result when I trying to connect to MS Access database: +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select * from table; lablablab... Here is a small php code: $conn = odbc_connect("DSN","",""); $select = "SELECT * FROM TABLE"; $result = odbc_exec($conn, $select); while ($row = odbc_fetch_array($result)) { $rowid = $row['name1']; $pwd = $row['password']; } echo "Row id :".$rowid; echo "password : ".$pwd; The problem is, when I browse the file it as me to download it instead of explorer it, although the other projects with php and mysql are working well. Reproduce code: --------------- Here another small code after the tracing: $db = odbc_connect("LOIR","","",SQL_CUR_USE_ODBC); if (!$db) { die('ERROR: Cannot connect!'); } $sql = "SELECT * FROM st_student"; $result = odbc_exec($db, $sql) or die('ERROR: Cannot execute query!'); if (!$result) { exit("Error in SQL: ".$sql); } until now everything is okay unless this while array: while (odbc_fetch_array($result)) { echo odbc_result($result,"name1"); } odbc_close($db); Warning: odbc_fetch_array() [function.odbc-fetch-array]: No tuples available at this result index in /var/www/access.php on line 14 Although when I replace the above fetch array with this: $row = odbc_fetch_array($result); echo $row["name1"]; odbc_close($db); it return one row and when field. Expected result: ---------------- It supposed to return all 300 records in the database. Actual result: -------------- I don't have backtrace.. and I would appreciate your cooperation with this matter, because I'm tired now from it, since 4 days and I'm googling but no result. Cordially,