Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/06/2010, 15:43
Avatar de Sipy
Sipy
 
Fecha de Ingreso: febrero-2009
Mensajes: 47
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: Actualizar contenido de DIV con archivo php

si tienes razón, perdona xD

Este es el div:

Cita:
<div id="votos"><a href="#" onclick="new Ajax.Updater('votos','votos.php');"><?php echo $row["votos"]; ?></a></div>
Y el archivo php que hace el proceso este:

Cita:
<?php
include('funciones/conexionbd.php');

$noticia = $_GET['variable'];

$sql1 = "select votos from noticias where id = '$noticia'";
$resultados = mysql_query($sql1);
if($row = mysql_fetch_array($resultados)) {

$votosnue = $row["votos"] + 1;

$sql = "update noticias set votos = '$votosnue' where id = '$noticia'";

$resultados = mysql_query($sql);

}
echo $votosnue;
?>
Muchas gracias un saludo