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 ');
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} ";
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.