PHP Local modification Test OK, to the server is not, which master can help my brother

Source: Internet
Author: User
PHP Local modification Test OK, to the server is not, who can help me?
Local testing is possible, that is, to the server is not, receive values and connections are not a problem. The following is the code written to the database, it feels that it is wrong, but can not find the cause of the error, please help to see, thank you
----------Split Line----------------

Require_once (".. /conn.inc.php ");//contains database connection file
Receive form values
$netsId =$_get[' id '];
if ($netsId = = NULL) {
$netsId =$_get[' id '];
}else
if ($_get[' id '] = = NULL) {
Echo ' did not modify the information! ';
}
Echo $netsId;
$user _name=$_post["user_name"];
$user _psw=$_post["USER_PSW"];
$user _ip=$_post["User_ip"];
$net _name=$_post["Net_name"];
echo $net _name;
$net _url=$_post["Net_url"];
$net _type=$_post["Net_type"];
$Province =$_post["province"];
$City =$_post[' city ';
$net _content=$_post["Net_content"];
Pre-defined variables
$net _num=$_post["Net_num"];
$net _in=$_post["net_in"];
$net _out=$_post["Net_out"];
$net _ok=$_post["NET_OK"];
$net _recom=$_post["net_recom"];

System time Difference 8-hour problem
Date_default_timezone_set (' asia/chongqing ');
$now = getdate (Time ());
$cur _wday= $now [' wday '];
$date = Date ("y-m-d h:i:s $cweekday [$cur _wday]");
$net _submit_time = Date ("y-m-d h:i:s");
$last _time = $_post["Last_time"];
if ($City = = NULL)
{
$City = $_post[' Citydefault ');

}

Input Action Statement
$sql = "UPDATE nets SET user_name = ' $user _name ', user_psw = ' $user _psw ', user_ip = ' $user _ip ', net_name = ' $net _name ', Net_ur L = ' $net _url ', Net_type = ' $net _type ', province = ' $Province ', city = ' $City ', net_content = ' $net _content ', net_num = $net _nu m,net_in = $net _in,net_out = $net _OUT,NET_OK = $net _ok,net_recom = $net _recom,net_submit_time = ' $net _submit_time ', last_ Time = ' $last _time ' where id = $netsId ';

mysql_query ($sql);//pass operation statements to MySQL database
echo "website modified successfully! ";
Echo ' You can also return to the homepage or ';
Echo ' Click Back ';
Echo ' modified ID number: '. $netsId. ';

?>

------Solution--------------------
Do not check function return values?
------Solution--------------------
Send the wrong message up.
------Solution--------------------
discuss

Send the wrong message up.

------Solution--------------------
discuss

Reference:
Reference:

Send the wrong message up.


Yes, send the wrong hints. Simple and quick


Show this sentence, do not know what meaning ...
The information was not successfully written to the database! You have a error in your SQL syntax; Check the manual that corresponds to your MySQL server ve ...

------Solution--------------------
Modify the SQL statement to look like this.
id={$netsId} ";

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.