SELECT erroneous concatenation

Issue #358 resolved
Former user created an issue

SELECT "1","1","1"

yields: "1" not "1","1","1" as expected.

See screenshot.

phpLiteAdmin running on Synology php7.

Haven't been able to check whether this is a Synology problem.

Same result for php7 and php5.6

Comments (2)

  1. phpLiteAdmin repo owner

    Thank you for your report. The problem was that fetching an associative array would only give one column, as all columns have the same column name. Fetching a numeric array does not give column names, so they have to be fetched separately. This is now done using $result->getColumnMeta($colNum)['name'] for PDO, $result->columnName($colNum) for SQLite3 and $result->fieldName($colNum) for SQliteDatabase.

    This now also alows queries like SELECT colA, colA FROM mytable that before displayed only one column colA in the result and now will display two columns colA.

  2. Log in to comment