1、你的 xgkcg.php 没有输出
2、你执行的是删除指令,mysql_fetch_row($result) 只会报错

解决方案 »

  1.   

    ajax是不能自动刷新页面的,可以如下实现
    success: function()
            {                              
                alert("成功取消订单!");      
                window.reload();       
            }
    或者不刷新的话 调用代码删除
    success: function()
            {                              
                alert("成功取消订单!");      
                    $(obj).closest('tr').remove();
            }
      

  2.   


    php的代码我又写成这样了,感觉挺不规范的,不知该如何改进?
    require_once("config.php");
    header('content-type:application/json');
    $oid=$_POST['oid'];
    $sql="delete from `djs_shops_orders` where oid = '$oid'";
    $result = mysql_query($sql);
    if($result){
    return true;
    }else{
    return false;
    }
      

  3.   

    require_once("config.php");
    header('content-type:application/json');
    $oid = addcslashes($_POST['oid']);//转义字符
    $sql = "delete from `djs_shops_orders` where oid = '$oid'";
    mysql_query($sql);
    if(mysql_affected_rows() > 0){//影响条数
    return true;
    }else{
    return false;
    }
      

  4.   

    加上转义字符就不能执行sql语句了。有没有什么更好的办法
      

  5.   

    你吧$sql打印出来看看 不能执行报什么错误了吗?