Int type input directly submits data as 0 instead of empty

WBOY
Release: 2016-09-08 08:43:51
Original
2047 people have browsed it

Int type input directly submits data as 0 instead of empty

The form has two database inputs of type int. If the data is submitted directly to the database, it will be 0 instead of empty.
The default value of the database is empty, not 0. But the effect I want is empty. How to solve it? Please give me some guidance. Thank you very much

Reply content:

Int type input directly submits data as 0 instead of empty

The form has two database inputs of type int. If the data is submitted directly to the database, it will be 0 instead of empty.
The default value of the database is empty, not 0. But the effect I want is empty. How to solve it? Please give me some guidance. Thank you very much

Use empty to detect whether the variable is empty, and then reassign the '' character. When inserted into the database, it will be empty.

java is so clearly divided, the front end is all strings. You can try rewriting the set method of the corresponding field of bean

The default value of this field in the database is set to 0. If no default value is given, it will be null

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!