Author Topic: PHP MySQL driver: problem with integer casting as strings, from database  (Read 639 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Hello,

We have an issue with our server. We are building an API system, and the integer values we get from the database are cast into strings when they hit the PHP codebase.

(the exact same code works fine on other xampp local dev environments)

After much research, our problem is most like with the PHP-MySQL driver.

https://stackoverflow.com/questions/20079320/php-pdo-mysql-how-do-i-return-integer-and-numeric-columns-from-mysql-as-int


Our sysadmin is telling me there is not much he can do about it, because we cannot just use a different CentOS PHP installation or PHP driver. We need to use PHP installation specifically through CWP, and compile PHP ourselves on the server each time.


Do you have any clue how we can tackle this issue? Any help appreciated.

Thanks!


[CWP7/CentOS 7.6.1810/PHP 7.1.22/MariaDB 10.1.37]

Offline
***
Re: PHP MySQL driver: problem with integer casting as strings, from database
« Reply #1 on: January 27, 2019, 07:28:35 PM »
This could be a specific issue of your server.

You must study the PHP documentation:
http://php.net/manual/pt_BR/book.mysqlnd.php

And check some incompatibility, if any.

Regards,
Netino