数据库-在线词典
2016-10-13 10:37
323 查看
mainView.php代码如下:
wordProccess.php
创建表:
<html> <head> <title>在线词典</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> </head> <body> <img src="ciba.png" /> <h>查询英语</h1> <form action="???" method="enword" /> <input type="hidden" value="search" name="type" /> <input type="submit" value="查询" /> </form> </body> </html>
wordProccess.php
<?php //引用工具类查询方法 require_once 'sqlTool.class.php'; //接受英文单词 if(isset($_POST['enword'])) { $en_word=$_POST['enword']; }else{ echo "输入为空"; echo "<a href='mainView.php'>返回重新查询</a>"; } //查看数据库中有没有这条记录 $sql="select * from 表名 where 条件" limit 0,1; // 查询一条即返回 //设计表,查询(面向对象) $sqlTool = new SqlTool(); $res = $sqlTool->execute_dql($res); //查询方法 if($row = mysql_fetch_row($res)) { // echo $en_word."对应的中文意思是--".$row[2]; } else { echo "查询没有这个词条"; echo "<br/><a href = 'mainView.php'>返回重新查询</a>"; } ?>
创建表:
//创建数据库 create database worddb; create table words( id int primary key auto_increment, enword varchar(32) not null, chword varchar(256) not null ) //导入数据 insert into words(enword,chword) values('boy', '男孩'); insert into words(enword, chword) value('school', '学校');
相关文章推荐
- PHP数据库编程③基于mysql的在线词典案例(只实现中英文互查)
- [代码发布]汉字转拼音 /成语词典/简体繁体在线互转
- 非常好的免费在线计算机词典
- 在线短消息收发的程序,不用数据库
- SUPCON ESP-iSYS实时数据库郑州培训在线报名
- 四川移动BOSS系统数据库在线备份解决方案
- 沪江小D - 在线词典
- 在线短消息收发的程序,不用数据库
- 在线日语词典
- ACESS数据库在线压缩备份
- [原创代码]汉字转拼音 /成语词典/简体繁体在线互转
- LazyBase - 在线数据库
- 在线管理数据库 类
- 基于数据库的在线人数,日访问量等统计
- 为什么运行时总是提示“Microsoft JET database Engine (0X80040E09)”不能更新,数据库或对象为只读?在线等...
- 汉字转拼音 /成语词典/简体繁体在线互转
- 现在是星期5凌晨2点多,前面发现原来在线考试系统需要用到那么多数据库操作:)
- 用asp.net在线备份SQL-Server数据库
- 基于数据库的在线人数,日访问量等统计
- 英语在线词典