|
![](/images/resource/spacer.gif) |
|
สอบถามการสร้างฟอร์มค้นหาจาก MySQL พร้อมโค๊ด ขอบคุณครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
Code (PHP)
....
....
<?php
$objConnect = mysql_connect("xxx","xxx","xxx") or die("Error Connect to Database");
$objDB = mysql_select_db("xxx");
mysql_query('SET NAMES utf8');
?>
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type="text" name="txtSearch" value="<?=$_POST["txtSearch"];?>"/>
<input type="submit" name="btnSubmit" value="Search"/>
</form>
<?php
$strSQL = "SELECT * FROM san";
if(isset($_POST['btnSubmit'])){
$strSQL .= " WHERE san.NAME LIKE '%".trim($_POST["txtSearch"])."%'";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
....
....
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-02-02 22:41:00 |
By :
sabaitip |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 00
|