|
|
|
UPLOAD FILE แล้ว ERROR อะไรก็ไม่รู้ครับ ข้อมูลก็ไม่เข้า File ก็ไม่ Cop ให้ |
|
|
|
|
|
|
|
Code (PHP)
<tr>
<input type="text" name="txtpd_cod" size="5" value="<?=$objResult["cInvCCode"];?>"><br>
<textarea type="text" name="txtpd_catelog" size="500"></textarea><br>
<input type="text" name="txthero1" size="20" value="name_hero1"/><input type="file" name="fileUpload1"><br>
<input type="text" name="txthero2" size="20" value="name_hero2"/><input type="file" name="fileUpload2"><br>
<input name="hdnLine" type="hidden" value="2">
</tr>
Code (PHP)
for($i=1;$i<=(int)($_POST["hdnLine"]);$i++)
{
if($_FILES["fileUpload".$i]["name"] != "")
{
if(move_uploaded_file($_FILES["fileUpload".$i]["tmp_name"],"../images/store/heros/".$_FILES["fileUpload".$i]["name"]))
{
$strSQL = "INSERT INTO page_catalog";
$strSQL .="(page_cInvCCode,lead_in,heros_1,heros_2,heros_1_name,heros_2_name)";
$strSQL .="VALUES";
$strSQL .="('".$_POST["txtpd_cod"]."','".$_POST["txtpd_catelog"]."','".$_FILES["fileUpload1"]['name']."','".$_FILES["fileUpload2"]['name']."','".$_POST["txthero1"]."','".$_POST["txthero2"]."')";
$objQuery = mssql_query($strSQL);
}
}
}
if($objQuery)
{
echo "<center>Save Done.</center>";
}
else
{
echo "<center>Error Save [".$strSQL."]</center>";
}
ถ้าเอา $_FILES ออก...มันก็ SAVE ได้นะครับ
Tag : PHP, Ms SQL Server 2008
|
|
|
|
|
|
Date :
2012-05-28 16:52:35 |
By :
time.toon |
View :
910 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใส่ enctype="multipart/form-data" ยังครับ
|
|
|
|
|
Date :
2012-05-28 17:02:56 |
By :
iamatomix |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โอ้ว.........ลืม.........จุดใต้...ตำตอ
ขอบคุณครับ
|
|
|
|
|
Date :
2012-05-28 17:07:11 |
By :
time.toon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|