php如何向mysql字段中写入NULL的值?
问题:
修改房屋信息时,有一个字段是楼层总数floorall,是int字段,允许空
当修改信息时,如果输入了这个字段的值,则向数据库中写入值,如果没有输入值,则向数据库中写入NULL
怎么实现?
我是这样写的
if($floorall==''){$floorall=NULL;} $db->query("updata tabel set floorall ='$floorall'");
回答:
你好,请执行以下语句:
updata tabel set floorall = null
以上就是php如何向mysql字段中写入NULL的值?的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
