ahhh , le puedo hacer un SELECT y despues con el IF , como le digo con IF que si no existe un registro en la BD que haga el insert y que sino haga el UPDATE ?
Yo hise esto pero no funciona , esta mal dicho el IF del principio :
Código PHP:
<?
include("config.php");
$silla = mysql_query("SELECT * FROM puntos");
$sll = mysql_fetch_array($silla);
if($sll[id_usuario] && $sll[nombre_post] && $sll[id_post]=="")
{
mysql_query("INSERT INTO puntos (id_usuario, nombre_post, id_post) VALUES ('$_GET[id_usuario]', '$_GET[nombre_post]', '$_GET[id_post]')");
mysql_query("UPDATE puntos SET puntos=(puntos+$_GET[puntos])");
echo'<script>
alert("Puntos agregados");
</script>';
}
else
{
mysql_query("UPDATE puntos SET puntos=(puntos+$_GET[puntos])");
echo'<script>
alert("Puntos agregados");
</script>';
}
?>
PD: TAMBIEN PROBE CON:
Código PHP:
if($sll[id_usuario] && $sll[nombre_post] && $sll[id_post]==NULL)
Pero no funca , como lo puedo hacer ?