0) $tipo=SacaDato("os","impresiones.paginas","idpagina=".$idp."",$link); if ($tipo=="") $tipo=0; mysql_query("INSERT INTO impresiones_new.iw_noscript (fecha, tipo, veces) VALUES ('".$fecha."', '".$tipo."', 0)",$link); mysql_query("UPDATE impresiones_new.iw_noscript SET veces=veces+1 WHERE fecha='".$fecha."' AND tipo='".$tipo."'",$link); function SacaDato($dato,$tabla,$filtro,$mysql) { $result=mysql_query("SELECT ".$dato." FROM ".$tabla." WHERE ".$filtro." LIMIT 1",$mysql); if (mysql_num_rows($result)) $dato=mysql_result($result, 0, 0); else $dato=false; return $dato; } mysql_close($link); ?>