Home > Backend Development > PHP Tutorial > 数据库中的自递增,php mysql_query插入如何写

数据库中的自递增,php mysql_query插入如何写

WBOY
Release: 2016-06-13 12:07:05
Original
1116 people have browsed it

数据库中的自递增,php mysql_query插入怎么写?
数据库
create database umx;
use umx;
create table if not exists umxtable(
uid int(10) unsigned not null auto_increment primary key COMMENT '唯一标示',
email varchar(100) not null COMMENT '电子邮件'
)AUTO_INCREMENT=1;

web页面只有一个输入框,就是输入一个电子邮件。
在php中,如果要插入数据,使用mysql_query(“这里怎么写?”),我不希望手动输入uid,让它自动增加就可以。


------解决思路----------------------
楼主,用NULL来代替值。values(null,[email protected]')

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