PHP本地修改測試OK,到伺服器上就不行了,哪位高手能幫幫小弟我

來源:互聯網
上載者:User
PHP本地修改測試OK,到伺服器上就不行了,誰能幫幫我?
本地測試都是可以的,就是到伺服器上就不行了,接收值和串連都沒有問題。以下是寫入資料庫的代碼,感覺是它出錯,但是找不到錯誤原因,請大家幫忙看看,謝謝了
----------分割線----------------

require_once("../conn.inc.php");//包含資料庫連接檔案
//接收表單值
$netsId=$_GET['id'];
//if($netsId == NULL){
//$netsId=$_GET['id'];
//}else
if($_GET['id'] == NULL){
echo '沒有修改資訊!';
}
//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"];
//預定義變數
$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"];

//系統時間差8小時問題
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'];

}

//輸入動作陳述式
$sql = "UPDATE nets SET user_name = '$user_name',user_psw = '$user_psw',user_ip = '$user_ip',net_name = '$net_name',net_url = '$net_url',net_type = '$net_type',Province = '$Province',City = '$City',net_content = '$net_content',net_num = $net_num,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);//傳遞動作陳述式至mysql資料庫
echo "網站修改成功!";
echo '您還可以返回首頁 或者 ';
echo '點擊返回';
//echo '修改的ID號為:'.$netsId.'';

?>

------解決方案--------------------
不檢查函數傳回值?
------解決方案--------------------
把錯誤資訊發上來啊。
------解決方案--------------------
探討

把錯誤資訊發上來啊。

------解決方案--------------------
探討

引用:
引用:

把錯誤資訊發上來啊。


是的,把錯誤提示發上來.簡單快捷


顯示這句,不知道什麼意思……
資訊沒有成功寫入資料庫!You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve……

------解決方案--------------------
將SQL 陳述式修改成這個樣子 試看看
id={$netsId}";

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.