 |
มันค้างใจอยู่ในลึกๆ ทำไมไม่ได้สักทีเป็นเพราะอะไรใครช่วยที! |
|
 |
|
|
 |
 |
|
เข้าเรื่องเลยนะคับ พอรันขึ้นว่า Parse error: syntax error, unexpected '}' in C:\AppServ\www\Admin\fixproduct.php on line 82
พอลบline 82ออกก็ขึ้น line83อีก ลบline83ออก
พอรันpopupขึ้นก่อนเลยว่า:บันทึกข้อมูลแล้ว พอใส่idที่มีแล้วขึ้นpopupมีสินค้านี้แล้ว ตามด้วยขึ้นpopupบันทึกข้อมูลแล้ว
พอใส่idที่ว่างขึ้นpopupบันทึกข้อมูลแล้ว2ครั้งแต่ไม่บันทึกให้ ขอบคุณคับ (เซ็งสุดค้างใจมาก)
<?php
include("config.php");
mysql_query("SET NAMES 'tis620'");
$IDProduct = $_POST["IDProduct"];
$sql = "SELECT IDProduct FROM fixproduct WHERE IDProduct='$IDProduct'" ;
$table = mysql_query($sql,$conn) or die ("ไม่สามารถติดต่อได้");
$numrow = mysql_num_rows($table);
if($numrow!=0) {
echo "<script language='javascript'>alert('มีรหัสสินค้านี้แล้ว');history.back();</script> ";
}else{
$sql = "INSERT INTO fixproduct(IDProduct ,Description , Price, Retail, PV)
values
('$IDProduct', '$Description','$Price', '$Retail','$PV')";
echo "<script language='javascript'>alert('บันทึกข้อมูลแล้ว');history.back();</script> ";
exit();
$dbquery = mysql_query($sql, $conn);
mysql_close();
}
} >>>>>>>line 82
} >>>>>>>line 83
?>
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2009-08-18 21:54:15 |
By :
gofgof |
View :
1129 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php
include("config.php");
mysql_query("SET NAMES 'tis620'");
$IDProduct = $_POST["IDProduct"];
$sql = "SELECT IDProduct FROM fixproduct WHERE IDProduct='$IDProduct'" ;
$table = mysql_query($sql,$conn) or die ("ไม่สามารถติดต่อได้");
$numrow = mysql_num_rows($table);
if($numrow!=0)
{
echo "<script language='javascript'>alert('มีรหัสสินค้านี้แล้ว');history.back();</script> ";
}
else
{
$sql = "INSERT INTO fixproduct(IDProduct ,Description , Price, Retail, PV) values ('$IDProduct', '$Description','$Price', '$Retail','$PV')";
echo "<script language='javascript'>alert('บันทึกข้อมูลแล้ว');history.back();</script> ";
exit();
$dbquery = mysql_query($sql, $conn);
mysql_close();
}
?>
|
 |
 |
 |
 |
Date :
2009-08-18 22:01:48 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php
include("config.php");
mysql_query("SET NAMES 'tis620'");
$IDProduct = $_POST["IDProduct"];
$sql = "SELECT IDProduct FROM fixproduct WHERE IDProduct='$IDProduct'" ;
$table = mysql_query($sql,$conn) or die ("ไม่สามารถติดต่อได้");
$numrow = mysql_num_rows($table);
if($numrow > 0)
{
echo "<script language='javascript'>alert('มีรหัสสินค้านี้แล้ว');history.back();</script> ";
}
else
{
$sql = "INSERT INTO fixproduct(IDProduct ,Description , Price, Retail, PV) values
('".$_POST['IDProduct']."',
'".$_POST['Description']."',
'".$_POST['Price']."',
'".$_POST['Retail']."',
'".$_POST['PV']."');";
echo $sql;
$dbquery = mysql_query($sql, $conn)
if($dbquery)
{
echo "<script language='javascript'>alert('บันทึกข้อมูลแล้ว');history.back();</script> ";
exit();
}
mysql_close();
}
?>
แก้ตัวครับ อิ อิ รีบไปหน่อย ไม่ทันมอง
|
 |
 |
 |
 |
Date :
2009-08-18 22:12:22 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากมากคับ ไว้ผมจะลองดูหากไม่ได้ผมจะมาถามใหม่นะคับ แต่ตอนนี้ขอกินยานอนก่อนไม่ไหวแล้วอ่ะไงคุณDownsTream และพี่ๆชาวthaicreate รักษาสุขภาพด้วยนะคับ กลัวจะเป็นเหมือนผมกันแย่เลย
|
 |
 |
 |
 |
Date :
2009-08-18 23:00:27 |
By :
gofgof |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ต้องเขียน Code ให้เป็นระเบียบ หน่อย
จะได้หาง่ายขึ้นครับ
loop ใคร loop มัน
ดูถ้าจะเช็คมากไปหน่อย
|
 |
 |
 |
 |
Date :
2009-08-19 10:55:01 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|