ahh, ahi lo mejore un poco , pero ahora me registra dos veces el mismo id_post
Código PHP:
<?
include("config.php");
$silla = mysql_query("SELECT * FROM puntos");
$tuplas = mysql_num_rows($silla);
if(!$tuplas[id_post]){
mysql_query("INSERT INTO puntos (id_usuario, nombre_post, id_post, puntos) VALUES ('$_GET[id_usuario]', '$_GET[nombre_post]', '$_GET[id_post]', '$_GET[puntos]')");
mysql_query("UPDATE usuarios SET puntos=(puntos-$_GET[puntos])");
echo'<script>
alert("Puntos agregados");
</script>';
}
else
{
mysql_query("UPDATE puntos SET puntos=(puntos+$_GET[puntos])");
mysql_query("UPDATE usuarios SET puntos=(puntos-$_GET[puntos])");
echo'<script>
alert("Puntos agregados");
</script>';
}
?>