婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > PHP+MySQL實現模糊查詢員工信息功能示例

PHP+MySQL實現模糊查詢員工信息功能示例

熱門標簽:拉薩打電話機器人 哈爾濱400電話辦理到易號網 智能外呼電銷系統 電銷機器人-快迭智能 寶安400電話辦理 h5 地圖標注 高識別電銷機器人 沈陽人工智能電銷機器人公司 合肥外呼系統app

本文實例講述了PHP+MySQL實現模糊查詢員工信息功能。分享給大家供大家參考,具體如下:

一、代碼

注意兩點:

1、用Notepad+編輯時,格式選擇:【編碼字符集】->【中文】->【gb2312】

2、

meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

conn.php

?php
$connID=mysql_connect("localhost","root","root");
mysql_select_db("db_database13", $connID);
mysql_query("set names gbk");
?>

index.php

?php session_start(); include("conn/conn.php");?>
html>
head>
meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
title> 查詢企業員工的詳細信息/title>
style type="text/css">
!--
.STYLE4 {font-size: 13px}
.STYLE5 {font-family: "華文琥珀"; font-size: 20px;}
.STYLE6 {color: #990000}
-->
/style>
/head>
body>
table width="450" height="28" border="0" align="center" cellpadding="0" cellspacing="0">
 tr>
  td align="center" class="STYLE5 STYLE6">查詢企業員工的詳細信息/td>
 /tr>
/table>
form name="form1" method="post" action="?php echo $_SERVER['PHP_SELF']?>">
table width="450" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#990000">
 tr>
  td width="176" align="center" bgcolor="#FFFFFF">span class="STYLE1 STYLE4">按照員工的編號查詢/span>/td>
  td width="182" bgcolor="#FFFFFF">input name="number" type="text" id="number" />/td>
  td width="84" height="25" bgcolor="#FFFFFF">input type="hidden" name="flag" value="1" />input name="submit" type="submit" value="提交" />/td>
 /tr>
/table>
/form>
table width="450" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#990000">
 tr>
  td width="67" align="center" bgcolor="#FFFFFF" class="STYLE4">編號/td>
  td width="72" align="center" bgcolor="#FFFFFF" class="STYLE4">姓名/td>
  td width="119" align="center" bgcolor="#FFFFFF" class="STYLE4">電話/td>
  td width="182" height="25" align="center" bgcolor="#FFFFFF" class="STYLE4">地址/td>
 /tr>
 ?php
 if(isset($_POST["flag"]))
 {
   $query=mysql_query("select * from tb_employee where number like '%".$_POST["number"]."%'");
   if($query)
   {
     while($myrow=mysql_fetch_array($query))
     {
 ?>
 tr>
  td align="center" bgcolor="#FFFFFF" class="STYLE4">span class="STYLE2">?php echo $myrow[number];?>/span>/td>
  td align="center" bgcolor="#FFFFFF" class="STYLE4">span class="STYLE2">?php echo $myrow[name];?>/span>/td>
  td height="23" align="center" bgcolor="#FFFFFF" class="STYLE4">span class="STYLE2">?php echo $myrow[tel];?>/span>/td>
  td height="23" align="center" bgcolor="#FFFFFF" class="STYLE4">span class="STYLE2">?php echo $myrow[address];?>/span>/td>
 /tr>
 ?php
     }
   }
 }
 ?>
/table>
/body>
/html>

二、運行結果

瀏覽器選擇的編碼是gbk

更多關于PHP相關內容感興趣的讀者可查看本站專題:《php+mysql數據庫操作入門教程》、《php+mysqli數據庫程序設計技巧總結》、《php面向對象程序設計入門教程》、《PHP數組(Array)操作技巧大全》、《php字符串(string)用法總結》及《php常見數據庫操作技巧匯總》

希望本文所述對大家PHP程序設計有所幫助。

您可能感興趣的文章:
  • PHP+MySQL使用mysql_num_rows實現模糊查詢圖書信息功能
  • mysql中使用instr進行模糊查詢方法介紹
  • mysql模糊查詢like與REGEXP的使用詳細介紹
  • 淺談MySQL模糊查詢中通配符的轉義
  • Mybatis使用MySQL模糊查詢時輸入中文檢索不到結果怎么辦
  • MySQL模糊查詢語句整理集合

標簽:山東 巴中 張家口 梅州 林芝 威海 泰州 成都

巨人網絡通訊聲明:本文標題《PHP+MySQL實現模糊查詢員工信息功能示例》,本文關鍵詞  PHP+MySQL,實現,模糊,查詢,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《PHP+MySQL實現模糊查詢員工信息功能示例》相關的同類信息!
  • 本頁收集關于PHP+MySQL實現模糊查詢員工信息功能示例的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 华蓥市| 锡林郭勒盟| 浦县| 东乌珠穆沁旗| 北碚区| 宜章县| 游戏| 临沂市| 麦盖提县| 集贤县| 辛集市| 孝昌县| 石渠县| 沙湾县| 若尔盖县| 同心县| 景东| 长泰县| 镇原县| 林芝县| 东乡| 东山县| 密云县| 城口县| 内黄县| 玉林市| 黔西| 临高县| 贡觉县| 九龙坡区| 宜兰县| 通道| 墨竹工卡县| 浑源县| 湖北省| 抚顺县| 布拖县| 金阳县| 历史| 永吉县| 凉城县|