Home >PHP Framework >ThinkPHP >Solve the problem of A non well formed numeric value encountered in TP5.1

Solve the problem of A non well formed numeric value encountered in TP5.1

藏色散人
藏色散人forward
2021-04-26 16:49:392752browse

The following tutorial column will introduce to you how to solve the problem of A non well formed numeric value encountered in TP5.1. I hope it will be helpful to friends in need!

A non well formed numeric value encountered problem occurred in TP5.1

Solve the problem of A non well formed numeric value encountered in TP5.1

Blog description

The information involved in the article comes from the Internet and personal summary. It is intended to summarize personal learning and experience. If there is any infringement, please contact me to delete it. Thank you! Problem introduction

A non well formed numeric value encountered

Such a problem is caused by the failure of tp5.1 to automatically convert the time formatFor example, the fields in the database are in varchar format, and the code is written in tp5.1. The field is automatically converted into the timestamp format, and an error will occur.

Problem Solution

Use time fields in the database, or use int type, or not use the automatic conversion of tp5.1

Related recommendations:
Latest 10 thinkphp video tutorial

The above is the detailed content of Solve the problem of A non well formed numeric value encountered in TP5.1. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete