|
 |
|
ไม่ยอมแสดงข้อมูล ช่วยตอบกระทู้หน่อยนะค่ะ คือว่าตามหน้าเว็บที่ปรากฏนะค่ะ |
|
 |
|
|
 |
 |
|
ช่วยตอบกระทู้หน่อยนะค่ะ คือว่าตามหน้าเว็บที่ปรากฏนะค่ะ เวลาทำการค้นหาแล้วไม่ยอมแสดงข้อมูล เนี่ยคือรูปหน้าจอของหนู

------------------------------------------------------------------------------------------------------------------------------
ส่วนนี้โค้ดค่ะ ถ้ามีการแก้ไขตรงไหนก็รบกวนดูให้หน่อยนะค่ะ
ขอบคุณค่ะ
Code (PHP)
<?php
//session_start();
include("connect.php");
function cutstring($str, $len) {
if (strlen($str)<=$len) return $str;
else return sprintf("%.".$len."s..", $str);
}
$i_institute = mysql_query("select * from department order by DepartID;"); //หน่วยงาน
$Maj = mysql_query("select * from Major order by ID;"); //สาขาผลงาน
$pro= mysql_query("select * from major where ID ORDER BY ID ASC");
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($dbname, $conn);
$query_rsDepart =("select * from department order by DepartID ") ;
$rsDepart = mysql_query($query_rsDepart, $conn) or die(mysql_error());
$row_rsDepart = mysql_fetch_assoc($rsDepart);
$totalRows_rsDepart = mysql_num_rows($rsDepart);
mysql_select_db($dbname, $conn);
$query_rsMajor =("select * from major order by ID ") ;
$rsMajor = mysql_query($query_rsMajor, $conn) or die(mysql_error());
$row_rsMajor = mysql_fetch_assoc($rsMajor);
$totalRows_rsMajor = mysql_num_rows($rsMajor);
mysql_select_db($dbname, $conn);
$query_rsfile =("select * from filex order by ID ") ;
$rsfile = mysql_query($query_rsfile, $conn) or die(mysql_error());
$row_rsfile = mysql_fetch_assoc($rsfile);
$totalRows_rsfile = mysql_num_rows($rsfile);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>ระบบสืบค้นข้อมูลผลงานเด่น</title>
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style>
</head>
<body>
<form id="Checkform" name="Checkform" method="post" onSubmit="return check()" action="result_search.php">
<table width="212" height="187" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="12"><img src="image/barlogin_01.jpg" width="12" height="12"></td>
<td width="184"><img src="image/barlogin_02.jpg" width="188" height="12"></td>
<td width="15"><img src="image/barlogin_03.jpg" width="15" height="12"></td>
</tr>
<tr>
<td><img src="image/barlogin_04.jpg" width="12" height="185"></td>
<td><table width="188" height="145" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="image/home.gif" width="20" height="20"> <a href="index.php"><strong>หน้าหลัก</strong></a> </td>
</tr>
<tr>
<td height="22"><u>ค้นหา</u></td>
</tr>
<form id="Checkform" name="Checkform" method="post" onSubmit="return check()" action="result_search.php">
<tr>
<td>คำค้น:
<label>
<input name="Name" type="text" id="Name">
</label></td>
</tr>
<tr>
<td>
<label>
ค้นหาจาก:
<select name="DepartID" id="DepartID">
<option selected="selected" value="">กรุณาเลือกหน่วยงาน</option>
<?php while( $arrs3=mysql_fetch_array($i_institute)){ ?>
<option value="<?=$arrs3[DepartID]; ?>"
<?php if($_SESSION["i_institute"] == $arrs3[DepartID] )echo "selected"; ?>>
<?php
$return3=cutstring($arrs3[DepName],25);
echo $return3;?></option>
<?php } ?>
</select>
</label> </td>
</tr>
<tr>
<td>สาขาผลงาน : </td>
</tr>
<tr>
<td><select name="major" id="text">
<option selected="selected" value="">กรุณาเลือกสาขาผลงาน</option>
<?php while( $arrs4=mysql_fetch_array($Maj)){ ?>
<option value="<?=$arrs4[ID]; ?>"
<?php if($_SESSION["Maj"] == $arrs4[ID] )echo "selected"; ?>>
<?php
$return4=cutstring($arrs4[Mname],25);
echo $return4;?>
</option>
<?php } ?>
</select></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
<input type="submit" type="button" onClick="NewWindow"name="Submit" value="ค้นหา">
<input name="Reset" type="button" value="ยกเลิก" id="button" onclick="window.location.href='index.php';" />
</div></td>
</tr>
</table></td>
</form>
<td><img src="image/barlogin_06.jpg" width="15" height="185"></td>
</tr>
<tr>
<td><img src="image/barlogin_07.jpg" width="12" height="15"></td>
<td><img src="image/barlogin_08.jpg" width="188" height="15"></td>
<td><img src="image/barlogin_09.jpg" width="15" height="15"></td>
</tr>
</table>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="image/barlogin_01.jpg" width="12" height="12"></td>
<td><img src="image/barlogin_02.jpg" width="188" height="12"></td>
<td><img src="image/barlogin_03.jpg" width="15" height="12"></td>
</tr>
<tr>
<td><img src="image/barlogin_04.jpg" width="12" height="810"></td>
<td valign="top"><table width="184" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><img src="image/icon.gif" width="10" height="10"> <strong>หมวดหมู่</strong></td>
</tr>
<tr>
<td> </td>
</tr>
<?php
if(mysql_num_rows($pro)!= 0)
{
for($i = 0;$i < mysql_num_rows($pro);$i++)
{
?>
<tr>
<td> <img src="image/arrow-23.gif" width="17" height="9"> <a href='data_all.php?search=1&&ID=<?php echo mysql_result($pro,$i,"ID"); ?>' onMouseover=highlight(this,'#C0C0C0') onMouseout="highlight(this,'')"><?php echo mysql_result($pro,$i,"Mname"); ?></a></td>
</tr>
<?php }
}
else
{?>
<tr>
<td>ไม่พบข้อมูล</td>
</tr>
<?php } ?>
</table></td>
<td><img src="image/barlogin_06.jpg" width="15" height="810"></td>
</tr>
<tr>
<td><img src="image/barlogin_07.jpg" width="12" height="15"></td>
<td><img src="image/barlogin_08.jpg" width="188" height="15"></td>
<td><img src="image/barlogin_09.jpg" width="15" height="15"></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsDepart);
mysql_free_result($rsMajor);
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-11-19 11:14:38 |
By :
kabton_hok |
View :
5863 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 05
|