最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 数据库内容搜索(搜索指定内容并输出)
时间:2022-06-24 19:09:56 编辑:袖梨 来源:一聚教程网
首先我们来创建搜索数据表
create table if not exists `search` (
`id` int(4) not null auto_increment,
`keyword` varchar(500) not null,
primary key (`id`)
) engine=myisam default charset=utf8 auto_increment=1 ;
保存数据
| 代码如下 | 复制代码 |
| insert into `acc`.`search` ( `id` , `keyword` ) values ( null , '内容搜索' ), ( null , 'php站内搜索' ); |
|
*/
//数据连接
| 代码如下 | 复制代码 |
|
$conn = mysql教程_connect('localhost','ac','1');//这里的ac用户名,1是密码,修改成你自己的mysql便可 $res = mysql_db_query('abc',"select * from search where keyword='内容搜索' ") or die(mysql_error()); if(mysql_num_rows($res) == 1) { |
|
/*
本站原创转载注明来源www.111com.net
*/
相关文章
- 如鸢新活动游春集远房亲戚攻略 低配置无核爆通关攻略 08-03
- 燕云十六声免费外观攻略 最难拿到的三个免费套怎么拿 08-03
- 《弧光突袭者》 Arc Raiders “往昔药方”任务攻略 08-03
- 虚无世界宝宝技能搭配攻略(发掘宝宝技能的无限可能) 08-03
- 颠覆认知 曝PS6双机型定价悬殊 多数玩家恐难承受 08-03
- 《盾勇队长技能更换攻略》(优化战斗力,拓展战术选择,走上巅峰之路) 08-03