|
|
|
ช่วยดูให้หน่อยคับ พี่ๆ มันไม่ error อะไร แต่มันไม่เก็บ อะคับ php form upload |
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<title></title>
</head>
<body>
<?
if(move_uploaded_file($_FILES["Picture"]["tmp_name"],"img/".$_FILES["Picture"]["name"]))
{
echo "Copy/Upload Complete<br>";
//*** Insert Record ***//
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("project");
$strSQL = "INSERT INTO product ";
$strSQL .="(ProductName,Picture,Price) VALUES ('".$_FILES["Picture"]["name"]."','".$_POST["ProductName"]."','".$_POST["Price"]."')";
$objQuery = mysql_query($strSQL);
}
?>
<a href="Product.php">View files</a>
</body>
</html>
หน้าsave_addproduct
|
ประวัติการแก้ไข 2012-12-21 21:54:21 2012-12-21 21:54:30 2012-12-21 21:54:39 2012-12-21 21:54:48 2012-12-21 21:54:57 2012-12-21 21:55:07 2012-12-21 21:55:18 2012-12-21 21:55:27 2012-12-21 21:55:37 2012-12-21 21:55:47 2012-12-21 21:55:58 2012-12-21 22:21:14 2012-12-21 22:23:25
|
|
|
|
Date :
2012-12-21 21:53:04 |
By :
waffle |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<?
mysql_connect("localhost","root","1234");
mysql_select_db("project");
$strSQL = "SELECT * FROM product";
$objQuery = mysql_query($strSQL) or die(mysql_error());
?>
<table width="327" border="1">
<tr>
<td width="101">ProductID</td>
<td width="101">Picture</td>
<td width="82">ProductName</td>
<td width="79">Price</td>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><?=$objResult["ProductID"];?></td>
<td><img src="img/<?=$objResult["Picture"];?>"></td>
<td><?=$objResult["ProductName"];?></td>
<td><?=$objResult["Price"];?></td>
<td><a href="order.php?ProductID=<?=$objResult["ProductID"];?>">Order</a></td>
</tr>
<?
}
?>
</table>
<br><br><a href="show.php">View Cart</a> | <a href="clear.php">Clear Cart</a>
<?
mysql_close();
?>
</body>
</html>
หน้า product
|
ประวัติการแก้ไข 2012-12-21 21:57:20 2012-12-21 21:57:33 2012-12-21 22:20:18
|
|
|
|
Date :
2012-12-21 21:53:54 |
By :
waffle |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วคับ ขอโทดทีรบกวนคับ !! ^^
|
ประวัติการแก้ไข 2012-12-21 22:25:40
|
|
|
|
Date :
2012-12-21 22:25:10 |
By :
waffle |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ดีใจด้วย
|
|
|
|
|
Date :
2012-12-22 01:53:05 |
By :
บังเอิญผ่านมาเห็น |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2012-12-22 08:25:00 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|