|
|
|
ถามเรื่องการดึงข้อมุลจาก data base ครับ พอเข้าไปทำไมมันโชว์หมดเลย |
|
|
|
|
|
|
|
ตรง if($_POST["ddlGROUP1"] != "") ย้ายขึ้นไปให้คลุมตั้งแต่ connect database เลยครับ
คือถ้ายังไม่มีค่านี้ ยังไม่ต้องทำอะไรทั้งสิ้น
|
ประวัติการแก้ไข 2012-01-26 16:51:30
|
|
|
|
Date :
2012-01-26 16:51:04 |
By :
amuropao08 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<CENTER> <a href="book_search.php"><font color='#CC6666'></a><img src="lib.gif"> <font size='5'>Ê׺¤é¹µÒÁËÁÇ´ËÁÙè˹ѧÊ×Í</a>
<a href="book_search2.php"><font color='#CC6666'>Ê׺¤é¹µÒÁÃÒª×èÍ˹ѧÊ×Í</a> <img src="lib2.gif"></CENTER>
<CENTER>
<form name="frmSearch" method="post" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<table width="1000" border="1" bordercolor='#FFFFFF'>
<tr>
<th bgcolor='#33FF00'>àÅ×Í¡ËÁǴ˹ѧÊ×Í
<input type="hidden" name="Action" value="Search">
<select name="ddlGROUP1" id="ddlGROUP1">
<option>- àÅ×Í¡ËÁÇ´ -</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="300">Êѧ¤ÁÈÒʵÃì</option>
<option value="400">ÀÒÉÒÈÒʵÃì</option>
<option value="500">ÇÔ·ÂÒÈÒʵÃì</option>
<option value="700">ÈÔÅ»¡ÃÃÁáÅСÒúѹà·Ô§ </option>
<option value="800">ÇÃó¤´Õ</option>
<option value="900">»ÃÐÇѵÔÈÒʵÃìáÅÐÀÙÁÔÈÒʵÃì</option>
<option value="Ã">àÃ×èͧÊÑé¹</option>
<option value="Í">ÍéÒ§ÍÔ§</option>
<option value="¹">¹Ç¹ÔÂÒÂ</option>
<option value="Â">à´ç¡,àÂÒǪ¹</option>
<option value="¹ÔµÂÊÒÃ">¹ÔµÂÊÒÃ</option>
<option value="cd">CD,VCD,DVD</option>
<option value="qs">¡ÒÂÇÔÀÒ¤ÈÒʵÃì¢Í§Á¹ØÉÂì </option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
<option value="000">·ÑèÇä»</option>
<option value="100">»ÃÑÒ</option>
<option value="200">ÈÒʹÒ</option>
</select>
<input type="submit" value="¤é¹ËÒ"></th>
</tr>
</table>
</form>
<?
if($_POST["Action"] == "Search")
{
$objConnect = mysql_connect("mysql15.000webhost.com","a4456728_lib","banmi15110") or die("Error Connect to Database");
mysql_query("SET NAMES TIS620");
$objDB = mysql_select_db("a4456728_lib");
$strSQL = "SELECT * FROM book WHERE 1 ";
if($_POST["ddlGROUP1"] != "")
{
$strSQL .= " AND (GROUP1 = '".$_POST["ddlGROUP1"]."') ";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="1000" border="1" bordercolor='#FFFFFF' bgcolor=''>
<tr bgcolor='#CCCC66'>
<th width="20000"> <div align="center">ª×èÍ˹ѧÊ×Í</div></th>
<th width="10000"> <div align="center">¼Ùéáµè§</div></th>
<th width="15000"> <div align="center">Êӹѡ¾ÔÁ¾ì</div></th>
<th width="1000"> <div align="center">»Õ·Õè¾ÔÁ¾ì</div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr bgcolor='#33CCCC'>
<td><div align="center"><?=$objResult["BNAME1"];?></div></td>
<td><div align="center"><?=$objResult["WNAME"];?></div></td>
<td><div align="center"><?=$objResult["PUBLI"];?></div></td>
<td><div align="center"><?=$objResult["YPUBLI"];?></td>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
}
?></CENTER>
</body>
</html>
|
|
|
|
|
Date :
2012-01-26 16:54:54 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณนะครับ.
|
|
|
|
|
Date :
2012-01-27 19:51:25 |
By :
Beer_7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|