Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/01/2011, 08:48
angeles33
 
Fecha de Ingreso: noviembre-2007
Mensajes: 122
Antigüedad: 16 años, 5 meses
Puntos: 2
Respuesta: mostar registros de hoy

function Consultar ( $tabla, $campos = "*", $condicion = "1", $orden = "id", $mostrar = false ) {
if ($condicion=='true') $condicion = '1';
if ( $condicion )
$sql = 'Select '.$campos.' From '.$tabla.' Where '.$condicion.' Order By '.$orden.'';
else
$sql = 'Select '.$campos.' From '.$tabla.' Order By '.$orden.'';

$this -> sql = $sql;

if( $mostrar ) echo '<br>Consulta SQL: '.$sql.'<br>';

$this -> result = @mysql_query ( $sql, $this->conexion );

if ( $this -> result ) {
$this -> row = @mysql_fetch_array ( $this -> result );
$this -> num = @mysql_num_rows ( $this -> result );
return true;
} else {

echo "<br>**ERROR[".$this->database."][".$_SERVER['PHP_SELF']."]: Consulta SQL: $sql <br>";

return false;
}

}