Home > Backend Development > PHP Tutorial > 表单这里是不是要输入数据库中的字段呢

表单这里是不是要输入数据库中的字段呢

WBOY
Release: 2016-06-23 13:47:07
Original
702 people have browsed it

有点拿不准,求教


回复讨论(解决方案)

不用,比如数据库字段是aid,提交后台后接受数据用$aid = $_POST['AreaID'],$data['aid']=$aid;  插入数据库的时候字段对应它的值就行了

表单里面名称不一定要跟数据库的字段名一致,它只用于数据接收的时候使用;

如上假如你的数据字段为xxx_areaid(其他什么自己定义的都可以),你取的时候用表单名 $_GET['AreaID'];

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