我想更新我的聊天表通知列。但似乎我有一个错误的ajax脚本或PHP脚本

时间:2016-07-05 06:09:06

标签: php jquery mysql ajax

Ajax Code我想将我的empid和ownid提交给markread.php以用作$ _POST [' empid'];和$ _POST [' ownid'];

<script>
    $(document).ready(function(){    
       $(".chatlist").click(function(){
           var name = $(this).data('fullname');
           var empid = $(this).data('employeeid');
           var ownid = $('#yourownemployeeid').val();

           $.post('chat/markread.php', {empid: empid,ownid: ownid}, function(){
              //majority of code here...
           });    
       });
    });
</script>

Php Code

<?php

    include("../connection.php"); 
    $id = $_GET['empid'];
    $id2 = $_GET['ownid'];

    mysql_query("UPDATE chat SET notification = 'Seen'  WHERE recievernumber = '$id' and senderenumber = '$id2'");

?>

0 个答案:

没有答案