Ver Mensaje Individual
  #3 (permalink)  
Antiguo 31/03/2009, 10:27
majony
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Mensajes: 421
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: Que esta mal POO

No entiendo Gator se supone que cuando mando de aqui
Código html:
Ver original
  1. <form name="buscar" action="index.php?mod=noticias3&pag=listado_noticia" method="post">
  2.  
  3. <P>Mostrar noticias de la categoría:
  4.    <select name="categoria"> <option value=""> Escoger Lista </option>
  5.    <OPTION VALUE="Todas" SELECTED>Todas
  6.    <OPTION VALUE="Promociones">Promociones
  7.    <OPTION VALUE="Ofertas">Ofertas
  8.    <OPTION VALUE="Costas">Costas
  9.    <OPTION VALUE="GENERAL">GENERAL
  10. <INPUT TYPE="submit" NAME="actualizar" VALUE="Actualizar"></P>
  11. </FORM>
  12.  
  13.          <table border="1">
  14.          <tr>
  15.          <th align="center" colspan="7"> Lista de Delegados Deportivos </th>
  16.          </tr>

A mi controlador
Código php:
Ver original
  1. case 'listado_noticia':
  2.         default:
  3.            $categoria = $_POST['categoria'];
  4.            
  5.             $items_noticia1 = $MOD['noticias']->getNoticia($categoria);
  6.                 include('modulos/noticias3/vistas/listado_noticia.html.php');

Con mi modulo este
Código php:
Ver original
  1. function getNoticia($categoria) {
  2.             global $MOD;
  3.            
  4.             $consulta = $MOD['mysql']->consulta('SELECT * FROM noticias WHERE categoria='.$categoria);
  5.        
  6.             return $consulta;
  7.         }
  8.        
  9.         function getNoticias() {
  10.             global $MOD;
  11.            
  12.             $consulta = $MOD['mysql']->consulta('SELECT * FROM noticias');
  13.        
  14.             return $consulta;
  15.         }

Me deberia mostrar lo que elegi en mi slect pero me nuestra el error aqui

Error: SELECT * FROM noticias WHERE categoria=GENERAL se que esta mal el modulo pero no se pq si toda la consulta esta bien
Bueno pongo como te select busco general pongo actualizar y no me muestra nada y me sale error= select etc etc