I am trying to update mysql database on cliking url in lecture.php. But update-lecture-count.php is not getting executed.
Code in lecture.php is as follows
<?php
session_start();
include("db.php");
?>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" > </script>
<script>
var $j = jQuery.noConflict();// i am also using jquery 1.9.0 in same page
$j('.reserve-button').click(function(){
var lec_id = $j(this).parent().data('id');
$j.ajax
({
url: 'update-lecture-count.php',
data: {"lectureID": lec_id},
type: 'post'
});
});
</script>
</head>
<body>
<div data-id="<?php echo $data['lecture_id'];?>">
/* lecture id, recording link are getting fetched from other mysql table*/
<a class="reserve-button fancybox fancybox.iframe more_info_btn" data-fancybox-href="<?=$data['recording_link']?>">PLAY NOW</a>
</div>
</body>
</html>
Code in update-lecture-count.php is as follows
<?
session_start();
include("db.php");
if(isset($_POST['lectureID']))
{
$_SESSION['value'] = $_POST['lectureID'];
$member_id = $_SESSION['user_id'];
//code to update mysql database.....
?>
I am unable to understand, why $_POST['lecture_id'] is not retrived in update-lecture-count.php