Expand|Select|Wrap|Line Numbers
- <script>
- $(document).ready(function() {
- var refreshId = setInterval(function(){
- $.ajax({
- type: "GET",
- url: "include/php/inboxcount.php",
- data: 'p=' +<? echo $username;?>.val(),
- success: function(count1){
- $('#showinboxcount').html(count1);
- }
- });
- });
- });
- </script>
Expand|Select|Wrap|Line Numbers
- <?php
- include_once "conn/db.php";
- $p = stripslashes(trim(htmlspecialchars($_GET['p'])));
- $s = mysql_query("SELECT * FROM conversations WHERE (sender = '$p' AND starterstatus = 'unread') OR (recipient = '$p' AND recipientstatus = 'unread') ORDER BY date");
- $i = 0;
- while($row = mysql_fetch_array($s)) {
- $i++;
- }
- echo $i;
- ?>