I want these functions to execute when javascript code executes;
function check_count2($userid,$picid){
$sql5 = "select count(*) from abctable
where persona='$kuladii123' and personb='$resimid'";
$result5 = mysql_query($sql5);
$row5 = mysql_fetch_row($result5);
return $row5[0];
}
function myfunction($userid,$picid){
$test = check_count2($userid,$picid);
if ($test == 0){
$sql6 = "insert into abctable (persona,personb)
values ($userid,$picid)";
$result6 = mysql_query($sql6);
}
}
Javascript code;
<script type="text/javascript">
$(".photos'.$picid.'").waypoint(function() {
myfunction(); // I WANT THIS FUNCTION HERE!
}
});
</script>
I can't call myfunction, please help me.