I was able to solve it, I will leave the method if someone is looking for how to do it
Javascript / Ajax function
function curti(codigo,identify){
$.ajax({
url:("ajax/curtir.php"),
type: "POST",
data: {"udid": codigo},
success:function(data){
$("#"+identify).html("("+data+")");
}})}
PHP function
<?php
header('content-type: application/json; charset=utf-8');
include('../class/mysql_crud.php');
$id = (isset($_POST['udid'])) ? (int)$_POST['udid'] : 0;
$db = new Database();
$db->connect();
$db->sql("SELECT * FROM musicas_home WHERE guid = $id");
$res = $db->getResult();
foreach($res as $output){
$curtirv = $output["curtir"];
}
$curtir = ($curtirv + 1);
$db->update('musicas_home',array('curtir'=>$curtir),'guid='.$id);
echo json_encode($curtir);
Button calling function with onclick
echo "<button id='$guidcurti' role='button' onClick='curti($guid,$guidcurti)' class='btn btn-default fa fa-thumbs-o-up'>($curtir)</button>";
Surely you can improve a lot, whoever wants to edit at will.