1
I would like that in this script below when clicking on the link it did the update in sql without Reload. it was made to perform through a Ubmit in a more would like it to be through a link even more not concegui 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>
<script type="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());
?>