In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to solve the problem when the database is stolen and replaced with a string type". The explanation in the article is simple and clear and easy to learn and understand. let's go deep into the editor's train of thought. Let's study and learn "how to solve the problem when the database is stolen and replaced with a string type"!
When implementing a multi-level menu function, it is found that the integer data obtained by Laravel from MySQL has been converted into string type, so that the corresponding data can not be obtained by using collection filter. But it doesn't appear on all machines, only on the server.
Development machine (Mac / Ubuntu 16.04)
[2016-07-07 08:17:43] local.INFO: [{"id": 1, "level": 1}]
Production environment (Ubuntu 12.04)
[2016-07-07 09:06:07] local.INFO: [{"id": 1, "level": "1"}]
You can see that the level field, which represents the menu level, becomes a string in a production environment.
It is confirmed that there is no problem with the table structure, indicating that the problem lies in the process of fetching the data. So Google found that the problem lies in the MySQL driver of PHP.
MySQL integer field is returned as string in PHP
Laravel eloquent integers returned as strings in mssql
This problem will not occur after PHP 5.3, so update the MySQL driver for PHP
Sudo apt-get update
Sudo apt-get install php5-mysqlnd
There is no need to restart Nginx, test again and find that everything is normal, indicating that the problem is solved.
[2016-07-07 09:22:38] local.INFO: [{"id": 1, "level": 1}]
Thank you for your reading, the above is the content of "how to solve the problem that the database was stolen and replaced with a string type". After the study of this article, I believe you have a deeper understanding of how to solve this problem when the database was stolen into a string type. the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.