Location: PHPKode > scripts > Tonapubli > tonapubli/show.php
<?
/*****************************
* Rotador de Banners
* Archivo: show.php
* Autor: Antonio Ignacio Fontenla
* Fecha: 22 feb 2004
**/
include ("lib.php");
mysql_select_db($base);

$sql = "SELECT * FROM $publibanners WHERE session='0' && status='0'";
$consulta = new consulta($sql);
if ($consulta->num_filas()==0){
$consulta = new consulta("UPDATE $publibanners SET session=0");
$consulta = new consulta("SELECT * FROM $publibanners WHERE session='0'
&& status='0'");
}
$row = $consulta->obtener_objeto();

if ($row->id != ""){
$query = new consulta("UPDATE $publibanners SET showed=showed+1, session='1' WHERE id='$row->id'");
echo "<A HREF=\"click.php?id=$row->id\" target=\"_blank\"><IMG Border=\"0\" SRC=\"$row->banner\"></A>";
}
?>
Return current item: Tonapubli