خرید بک لینک

Vote count: 0

Hi OnClick I am getting the total count from the database using jquery If I am on Same Page(TeamPage).Now I am on Home Page and I am clicking on Link to reach on Teampage.after reaching on teampage it's not showing count but Now Again I am Clicking on team link now it's showing Fav Count.

My problems
1.Now Anchor Tag is not working.
2.Update Count when User opens a link and change page also with updated count.

Jquery

 <script>   
        $('a.team_name').on('click',function (e){       
          var link = $(this).attr('id');
            // alert(link); 
           $.ajax({
           type:'GET',
           url :"views/inc/teampage_count.php",
           dataType: 'json',
           data: {id: link},
           success: function(data) {
                console.log('success',data);

                $('#getRequestdata').html(data);
                 //retuing success data from here

           },

           }); 
         e.preventDefault();
        });

</script>

HTML

<div class="pull-right"><h4>Likes:<span id="getRequestdata">Update Count Here</span></h4></div>

Php Query(Working Fine):

   $teamname = $_GET['id'];
  //echo $teamname;
  //Here I am Getting the Onclick value 

    $sql = "SELECT COUNT(*) FROM favteam WHERE team_code LIKE '%$teamname%'";
    $result = mysql_query($sql);

    if (! $result){
       throw new My_Db_Exception('Database error: ' . mysql_error());
    }

    while($row = mysql_fetch_assoc($result)){
      echo $row['COUNT(*)'];
    }

asked 44 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 10 فروردين 1395 ساعت: 16:41

صفحه بندی