Mysql
 sql >> Database >  >> RDS >> Mysql

Aggiornamento del database da Javascript chiamando lo script PHP

prova questo

<script type="text/javascript">
function process(LikeId) { 
//your validation code
$.ajax( {
        type: 'POST',
        url: LikeUnlike.php, //file where like unlike status change in database
        data:{like:LikeId},
        success: function(data) {
            //code you want to do after successfull process
        }
    } );
}
</script>

apportare modifiche in html

<a href='Javascript:void(0)' onclick='process(1)'>Like</a>
<a href='Javascript:void(0)' onclick='process(0)'>Unlike</a>