|
|
|
รบ กวนดูโค็ดให้หน่อยครับ ผม ค่าเงิน ออกมานะครับโดยให้ค่าเงินนั้นต้องมีลูก บอกหลักของราคาสินค้าด้วยนะครับ ผมลองหลายแต่ไม่ได้จริงๆนะครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php require_once('Connections/db_rice.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
$colname_Recordset1 = "-1";
if (isset($_POST['txtProduct'])) {
$colname_Recordset1 = $_POST['txtProduct'];
}
mysql_select_db($database_db_rice, $db_rice);
$query_Recordset1 = sprintf("SELECT * FROM v_productedit WHERE ProductId LIKE %s", GetSQLValueString("%" . $colname_Recordset1 . "%", "text"));
$Recordset1 = mysql_query($query_Recordset1, $db_rice) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="templates/main.css"/>
<title>Rice Mart</title>
</head>
<body>
<div class="container">
<?php require_once("templates/header.inc.php")?>
<?php require_once("templates/sidenav5.inc.php")?>
<form id="form1" name="form1" method="post" action="">
<div class="content">
<h1>ค้นหาข้อมูลสินค้า</h1>
<p>
<label for="txtProduct">ค้นหา</label>
<input type="text" name="txtProduct" id="txtProduct" />
<input type="submit" name="btnProduct" id="btnProduct" value="ค้นหา" />
</p>
<table border="1" align="center">
<tr>
<td>ชื่อสินค้า</td>
<td>ชื่อพันธุ์ข้าว</td>
<td>ราคา</td>
<td>รูปภาพ</td>
<td>แก้ไข</td>
<td>ลบ</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['ProductName']; ?></td>
<td><?php echo $row_Recordset1['RicESeedDesc']; ?></td>
<td><?php echo $row_Recordset1['price']; ?> บาท</td>
<td><img src ="/DW-DBrice/InsertData/img-products/<?php echo $row_Recordset1['Productimg']; ?>" alt="" width="100" height="100" /></td>
<td><a href="UpdateProduct.php?ProductId=<?php echo $row_Recordset1['ProductId']; ?>">แก้ไข</a></td>
<td><a href="deleteProduct.php?ProductId=<?php echo $row_Recordset1['ProductId']; ?>">ลบ</a></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</div>
</form>
<?php require_once("templates/footer.inc.php")?>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Tag : PHP, HTML, HTML5, JavaScript, XAMPP
|
|
|
|
|
|
Date :
2017-06-18 20:32:06 |
By :
bassnaruto |
View :
659 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลูกบอกหลัก ??
โค้ดนี้คือโค้ดที่ใช้ Dreamware ใช่ไม๊ครับ ไม่ได้เขียนเองใช่ไหม
|
|
|
|
|
Date :
2017-06-19 04:55:19 |
By :
deawx |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|