I would like that in the script below when we clicked the link it did the update in sql without the reload. it was made to perform through a submit in one more I would like it to be through a link even more I did not do. how can I do this?
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><scripttype="text/javascript">
jQuery(document).ready(function(){
jQuery('#ajax_form').submit(function(){
var dados = jQuery( this ).serialize();
jQuery.ajax({
type: "POST",
url: "update.php",
data: dados,
success: function( data )
{
alert( data );
}
});
return false;
});
});
</script>
Link to do the update
<a href="#" id="<?php echo $id?>">Mudar</a> // Pagando o id da linha
update.php
<?php
include"../../../../../clientes/assets/config.php";
$sql = "UPDATE notificacoes_geral SET status_lido='1' AND id= $id ";
$resultado = mysql_query($sql) or die( mysql_error());
? >