Código PHP:
$numlecturas++;
mysql_query("UPDATE noticia SET lecturas='$numlecturas' WHERE id='$_GET[id]' LIMIT 1 ");
alguien me ayuda?
| |||
error al sumar estoy usando el siguente codigo para agregar +1 a una noticia y verlo como visitas. Código PHP: alguien me ayuda? |
| |||
primero tendras q saber cuantas lecturas tenias en la base de datos no?? $res=mysql_query("select lecturas from noticias where id='$_GET[id]'",$connect); $lecturas=mysql_fetch_array($res); $numlecturas=$lecturas[lecturas]++; mysql_query("UPDATE noticia SET lecturas='$numlecturas' WHERE id='$_GET[id]' LIMIT 1 "); |
| |||
Cita: asi me sirve gracias a ambos
Iniciado por jahepi Hola darksteel01! Porque no nada mas aplicas así la consulta, sería mas fácil realizarla de esta manera... Código PHP: ![]() |