|
|
|
ช่วยผมทีครับ พอผมกด เซฟอัพเดท ข้อมูลแล้วมันขึ้น error save ครับ ผมมีรูป ครับ แต่แก้ไขเรคอดแรกได้ แเรคอดทีสองไม่ได้ครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
if(!empty($_POST));
$strSQL = "INSERT INTO scorep";
$strSQL .= "score1 = '".$_POST["score1"]."' ";
$strSQL .= ",score2 = '".$_POST["score2"]."' ";
$strSQL .= ",score3 = '".$_POST["score3"]."' ";
$strSQL .= ",score4 = '".$_POST["score4"]."' ";
$strSQL .= ",score5 = '".$_POST["score5"]."' ";
$strSQL .= ",score6 = '".$_POST["score6"]."' ";
$strSQL .= ",score7 = '".$_POST["score7"]."' ";
$strSQL .= ",score8 = '".$_POST["score8"]."' ";
$strSQL .= ",text1 = '".$_POST["txt1"]."' ";
$strSQL .= ",text2 = '".$_POST["txt2"]."' ";
$strSQL .= ",text3 = '".$_POST["txt3"]."' ";
$strSQL .= ",text4 = '".$_POST["txt4"]."' ";
$strSQL .= ",text5 = '".$_POST["txt5"]."' ";
$strSQL .= ",text6 = '".$_POST["txt6"]."' ";
$strSQL .= ",text7 = '".$_POST["txt7"]."' ";
$strSQL .= ",text8 = '".$_POST["txt8"]."' ";
$strSQL .= "WHERE UserID = '".$_GET["UID"]."' ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "Save Done.";
}
else
{
echo "Error Save [".$strSQL."]";
}
mysq
l_close($objConnect);
?>
Tag : PHP
|
|
|
|
|
|
Date :
2015-05-12 20:31:31 |
By :
Saharatza |
View :
581 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
if(!empty($_POST));
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("project");
$strSQL = "INSERT INTO scorep";
$strSQL .= "score1 = '".$_POST["score1"]."' ";
$strSQL .= ",score2 = '".$_POST["score2"]."' ";
$strSQL .= ",score3 = '".$_POST["score3"]."' ";
$strSQL .= ",score4 = '".$_POST["score4"]."' ";
$strSQL .= ",score5 = '".$_POST["score5"]."' ";
$strSQL .= ",score6 = '".$_POST["score6"]."' ";
$strSQL .= ",score7 = '".$_POST["score7"]."' ";
$strSQL .= ",score8 = '".$_POST["score8"]."' ";
$strSQL .= ",text1 = '".$_POST["txt1"]."' ";
$strSQL .= ",text2 = '".$_POST["txt2"]."' ";
$strSQL .= ",text3 = '".$_POST["txt3"]."' ";
$strSQL .= ",text4 = '".$_POST["txt4"]."' ";
$strSQL .= ",text5 = '".$_POST["txt5"]."' ";
$strSQL .= ",text6 = '".$_POST["txt6"]."' ";
$strSQL .= ",text7 = '".$_POST["txt7"]."' ";
$strSQL .= ",text8 = '".$_POST["txt8"]."' ";
$strSQL .= "WHERE UserID = '".$_GET["UID"]."' ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "Save Done.";
}
else
{
echo "Error Save [".$strSQL."]";
}
mysql_close($objConnect);
?>
|
|
|
|
|
Date :
2015-05-12 20:34:09 |
By :
Saharatza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตัวอย่างการ Insert ครับ
Code (PHP)
<?php
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
$strSQL = "INSERT INTO customer ";
$strSQL .="(CustomerID,Name,Email,CountryCode,Budget,Used) ";
$strSQL .="VALUES ";
$strSQL .="('".$_POST["txtCustomerID"]."','".$_POST["txtName"]."','".$_POST["txtEmail"]."' ";
$strSQL .=",'".$_POST["txtCountryCode"]."','".$_POST["txtBudget"]."','".$_POST["txtUsed"]."') ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "Save Done.";
}
else
{
echo "Error Save [".$strSQL."]";
}
mysql_close($objConnect);
?>
|
|
|
|
|
Date :
2015-05-13 09:51:32 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2015-05-13 14:27:36 |
By :
Saharatza |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Update ข้อมูลครับ
Code (PHP)
$strSQL = "UPDATE scorep SET ";
$strSQL .= "score1 = '".$_POST["score1"]."' ";
$strSQL .= ",score2 = '".$_POST["score2"]."' ";
$strSQL .= ",score3 = '".$_POST["score3"]."' ";
$strSQL .= ",score4 = '".$_POST["score4"]."' ";
$strSQL .= ",score5 = '".$_POST["score5"]."' ";
$strSQL .= ",score6 = '".$_POST["score6"]."' ";
$strSQL .= ",score7 = '".$_POST["score7"]."' ";
$strSQL .= ",score8 = '".$_POST["score8"]."' ";
$strSQL .= ",text1 = '".$_POST["txt1"]."' ";
$strSQL .= ",text2 = '".$_POST["txt2"]."' ";
$strSQL .= ",text3 = '".$_POST["txt3"]."' ";
$strSQL .= ",text4 = '".$_POST["txt4"]."' ";
$strSQL .= ",text5 = '".$_POST["txt5"]."' ";
$strSQL .= ",text6 = '".$_POST["txt6"]."' ";
$strSQL .= ",text7 = '".$_POST["txt7"]."' ";
$strSQL .= ",text8 = '".$_POST["txt8"]."' ";
$strSQL .= "WHERE UserID = '".$_GET["UID"]."' ";
|
|
|
|
|
Date :
2015-05-13 14:56:32 |
By :
slurpee55555 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|