search_user.php (หน้าแสดงผลการค้นหา)
<body>
<?
include ("connect.php") ;
$txtSearch = $_POST ['txtSearch'] ;
$txtbox = $_POST ['txtbox'] ;
switch ($txtSearch) {
case txtfname:
$sql =mysql_query("select * from admin where fname like '%$txtbox%'");
break;
case txtlname:
$sql =mysql_query("select * from admin where lname like '%$txtbox%'");
break;
case txtemail:
$sql =mysql_query("select * from admin where email like '%$txtbox%' ");
break;
$row=mysql_fetch_array($sql);
}
mysql_close();
{
?>
<?php
<?
include ("connect.php") ;
$txtSearch = $_POST ['txtSearch'] ;
$txtbox = $_POST ['txtbox'] ;
switch ($txtSearch) {
case "txtfname":
$sql =mysql_query("select * from admin where fname like '%$txtbox%'");
break;
case "txtlname":
$sql =mysql_query("select * from admin where lname like '%$txtbox%'");
break;
case "txtemail":
$sql =mysql_query("select * from admin where email like '%$txtbox%' ");
break;
$row=mysql_fetch_array($sql);
}
mysql_close();
{
?>
?>