PHP PDO ODBC SELECT возвращает частичные результаты - PullRequest
0 голосов
/ 07 марта 2019
<code>$db_a = new PDO("odbc:MYOB",'user','pass');

foreach($db_a->query("SELECT * FROM Sale WHERE SaleID = 108605") as $row) {
echo '<pre>';
print_r($row);
echo '
';}

Возвращает все заголовки столбцов таблицы, а также первые пять результатов, но все после этого остается пустым.Я попытался выполнить тот же оператор выбора через MS Access, и он работает правильно

Array
(
    [ItemSaleLineID] => 1605696
    [0] => 1605696
    [SaleLineID] => 1605696
    [1] => 1605696
    [SaleID] => 108605
    [2] => 108605
    [LineNumber] => 1
    [3] => 1
    [LineTypeID] => D
    [4] => D
    [Description] => 
    [5] => 
    [TaxExclusiveTotal] => 
    [6] => 
    [TaxInclusiveTotal] => 
    [7] => 
    [TaxCodeID] => 
    [8] => 
    [JobID] => 
    [9] => 
    [IsMultipleJob] => 
    [10] => 
    [Quantity] => 
    [11] => 
    [ItemID] => 
    [12] => 
    [TaxExclusiveUnitPrice] => 
    [13] => 
    [TaxInclusiveUnitPrice] => 
    [14] => 
    [Discount] => 
    [15] => 
    [CostOfGoodsSoldAmount] => 
    [16] => 
    [LocationID] => 
    [17] => 
    [Kit/ComponentIndicator] => 
    [18] => 
)

Вывод из var_dump:

array(20) { ["SaleLineID"]=> string(7) "1605696" [0]=> string(7) "1605696" ["SaleID"]=> string(6) "108605" [1]=> string(6) "108605" ["LineNumber"]=> string(1) "1" [2]=> string(1) "1" ["LineTypeID"]=> string(1) "D" [3]=> string(1) "D" ["Description"]=> NULL [4]=> NULL ["TaxExclusiveAmount"]=> NULL [5]=> NULL ["TaxInclusiveAmount"]=> NULL [6]=> NULL ["TaxCodeID"]=> NULL [7]=> NULL ["JobID"]=> NULL [8]=> NULL ["IsMultipleJob"]=> NULL [9]=> NULL } array(20) { ["SaleLineID"]=> string(7) "1605697" [0]=> string(7) "1605697" ["SaleID"]=> string(6) "108605" [1]=> string(6) "108605" ["LineNumber"]=> string(1) "2" [2]=> string(1) "2" ["LineTypeID"]=> string(1) "D" [3]=> string(1) "D" ["Description"]=> NULL [4]=> NULL ["TaxExclusiveAmount"]=> NULL [5]=> NULL ["TaxInclusiveAmount"]=> NULL [6]=> NULL ["TaxCodeID"]=> NULL [7]=> NULL ["JobID"]=> NULL [8]=> NULL ["IsMultipleJob"]=> NULL [9]=> NULL } array(20) { ["SaleLineID"]=> string(7) "1605698" [0]=> string(7) "1605698" ["SaleID"]=> string(6) "108605" [1]=> string(6) "108605" ["LineNumber"]=> string(1) "3" [2]=> string(1) "3" ["LineTypeID"]=> string(1) "D" [3]=> string(1) "D" ["Description"]=> NULL [4]=> NULL ["TaxExclusiveAmount"]=> NULL [5]=> NULL ["TaxInclusiveAmount"]=> NULL [6]=> NULL ["TaxCodeID"]=> NULL [7]=> NULL ["JobID"]=> NULL [8]=> NULL ["IsMultipleJob"]=> NULL [9]=> NULL }
...