I have a query SQL
that returns incomplete values
The connection to server
it is made through odbc_connect , and to get the rows odbc_fetch_array
The query is similar to the following
$conn = odbc_connect(__ODBC_NAME__,__ODBC_USER__,__ODBC_PASSWORD__);
$sql = "SELECT
codigo AS CODE,
login AS LOGIN,
nombre AS NAME,
'Comercial' AS ROLE
FROM usuarios
WHERE codigo != ''";
$ret = odbc_exec($conn,$sql);
$ar = odbc_fetch_array($ret);
// Array devuelto de ejemplo
/* array (
[CODE] => 5
[LOGIN] => email@gma
[NAME] => VICENT
[ROLE] => Comerc
)*/
// El ODBC es MultiBase/ODBC64 (Multiway)
When painting the array, it shows me something similar to what I show you above, the data is cut from a certain number of characters. The funny thing is that even the field ROLE
that uses a literal, also cuts it
The question is a bit ambiguous, but I've spent hours and I don't know where to go, any ideas?
Edit
I have tried to do the query with all the fields SELECT * FROM.....
and it returns some more characters, but it keeps cutting it. very rare
When there are problems with truncated data, try to configure
ODBC Long Read Length
, by:odbc.defaultlrl
onphp.ini
or byini_set()
, for example:odbc_longreadlen(resource $result_id , int $length)
( I recommend reading the comments in the doc )