|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-03-17 16:02 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-03-17 16:02 UTC] cmb@php.net
[2021-03-17 18:27 UTC] tony at tonymarston dot net
-Status: Feedback
+Status: Assigned
[2021-03-17 18:27 UTC] tony at tonymarston dot net
[2021-03-18 13:03 UTC] cmb@php.net
-Status: Assigned
+Status: Feedback
[2021-03-18 13:03 UTC] cmb@php.net
[2021-03-18 15:28 UTC] tony at tonymarston dot net
-Status: Feedback
+Status: Assigned
[2021-03-18 15:28 UTC] tony at tonymarston dot net
[2021-03-18 16:45 UTC] cmb@php.net
-Status: Assigned
+Status: Feedback
[2021-03-18 16:45 UTC] cmb@php.net
[2021-03-18 18:27 UTC] tony at tonymarston dot net
-Status: Feedback
+Status: Assigned
[2021-03-18 18:27 UTC] tony at tonymarston dot net
[2021-03-19 13:19 UTC] cmb@php.net
-Status: Assigned
+Status: Open
-Assigned To: cmb
+Assigned To:
[2021-03-19 13:19 UTC] cmb@php.net
[2021-03-20 16:41 UTC] tony at tonymarston dot net
[2021-04-21 12:35 UTC] cmb@php.net
[2021-04-21 14:38 UTC] tony at tonymarston dot net
[2021-06-05 08:52 UTC] tony at tonymarston dot net
[2021-09-06 09:35 UTC] jeremy dot galouye at gmail dot com
[2021-09-06 10:24 UTC] tony at tonymarston dot net
[2021-09-06 11:58 UTC] cmb@php.net
[2023-07-25 06:45 UTC] julia788maxwell at gmail dot com
[2023-07-26 18:31 UTC] tony at tonymarston dot net
[2024-05-03 08:58 UTC] angela683huey at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 20:00:01 2025 UTC |
Description: ------------ I have a database table in a SAP HANA database which contains currency codes and their symbols, but when I try to read them in my PHP program the rows containing symbols are not returned in the result set. Test script: --------------- CREATE TABLE currency ( currency_code nvarchar(16) NOT NULL, currency_name nvarchar(255) NOT NULL, currency_symbol nvarchar(4) DEFAULT NULL, PRIMARY KEY (currency_code) ); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('AUD', 'Australian Dollars', NULL); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('CAD', 'Canadian Dollars', NULL); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('EUR', 'Euros', '€'); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('GBP', 'UK Pounds', '£'); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('JPY', 'Japanese Yen', '¥'); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('SGD', 'Singapore Dollar', '$'); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('THB', 'Thai Baht', '฿'); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('USD', 'US Dollars', '$'); INSERT INTO currency (currency_code, currency_name, currency_symbol) VALUES ('YUAN', 'Chinese Yuan Renminbi', '元'); <?php $driver = 'HDBODBC'; $server = 'hxehost:39015'; $user = '****'; $pswd = '****'; $conn = odbc_connect("Driver=$driver;ServerNode=$server",$user,$pswd) OR die('Connection to DB via ODBC failed'); $query = "SELECT * FROM test.currency ORDER BY currency_code"; if (!$result = odbc_exec($conn, $query)) { die("ERRORNO=".odbc_error().", ERRORMSG=".odbc_errormsg()); }; $numrows = odbc_num_rows($result); while ($row = odbc_fetch_array($result)) { $array[] = array_change_key_case($row, CASE_LOWER); echo "<p>id={$row['CURRENCY_CODE']}, name={$row['CURRENCY_NAME']}, symbol={$row['CURRENCY_SYMBOL']}</p>\n"; } // while odbc_free_result($result); ?> Expected result: ---------------- The call to odbc_num_rows() returns '9' which is correct, but the call to odbc_fetch_array() only returns the first 2 rows and returns FALSE for the 3rd row.