最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ajax+php验证用户名重复代码实例
时间:2022-06-24 19:08:49 编辑:袖梨 来源:一聚教程网
代码如下 | 复制代码 |
代码如下 | 复制代码 | |||
|
把下面代码保存忝13.php
代码如下 | 复制代码 |
checkusername(); function checkusername() { $title = trim($_get['title']); if( empty( $title ) ) { return false; } else { mysql教程_connect('localhost','root','root'); mysql_select_db('test'); mysql_query("set names 'gb2312'"); $sql = "select * from cn_user where username ='$title'"; $row = mysql_query($sql); if( mysql_num_rows( $row ) ) { echo 1; } else { return null; } } } |
/*
create table `test`.`cn_user` (
`id` int not null auto_increment ,
`username` varchar( 20 ) not null ,
`times` date null ,
primary key ( `id` )
) engine = myisam
插入数据
insert into `test`.`cn_user` (
`id` ,
`username` ,
`times`
)
values (
null , 'jimmy', null
), (
null , 'www.111com.net', null
);
*/
?>
相关文章
- 幻兽帕鲁凉晶鲸BOSS在哪里-凉晶鲸BOSS位置介绍 07-12
- 原神艾梅莉埃天赋要升到多少级 艾梅莉埃天赋加点攻略 07-12
- 凤冠发朋友圈文案 07-12
- 剑星武器有哪些 全武器获取方式介绍 07-12
- SEI瞄准55%涨幅,原生USDC支持引发反向头肩形态突破 07-12
- 无畏契约源能行动斯凯技能详解 斯凯技能介绍 07-12