Ver Mensaje Individual
  #8 (permalink)  
Antiguo 11/05/2004, 13:21
Herminio Heredia San
 
Fecha de Ingreso: septiembre-2001
Ubicación: Monterrey
Mensajes: 663
Antigüedad: 22 años, 7 meses
Puntos: 6
Ejemplo de uso sencillo.
Código PHP:
$mp = &new NoticiaMapper();
    
$noticias $mp->obtListaNoticias();
    foreach(
$noticias as $noticia ){
    
        echo 
$noticia->obtId()."<br>\n";
        echo 
$noticia->obtTitulo()."<br>\n";
        echo 
$noticia->obtDescripcion()."<br>\n";
        echo 
$noticia->obtFecha()."<br>\n";
        echo 
$noticia->obtImagen()."<br>\n";
        echo 
$noticia->obtLiga()."<br>\n";
    
    } 
Uso sencillo agregar noticia:
Código PHP:
$datos = array( 'id_noticia'=>'',
                    
'id_usuario'=>'1',
                    
'titulo'=>'xxx',
                    
'descripcion'=>'yyyy',
                    
'fecha'=>'2003-02-01',
                    
'imagen'=>'algo.jpg',
                    
'link'=>'http://www.algo.com'
                    
);
                    
    
$noticia =& new Noticias($datos);
    
$mp = &new NoticiaMapper();
    if(
$mp->agregar($noticia)){
    
        exit(
'La notcia se agrego');    
    
    } 

Última edición por Herminio Heredia San; 11/05/2004 a las 13:44