Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/02/2012, 14:59
Avatar de erick_reyesg
erick_reyesg
 
Fecha de Ingreso: enero-2012
Ubicación: Guatemala
Mensajes: 53
Antigüedad: 12 años, 3 meses
Puntos: 2
Pregunta Consulta select y mysql

tengo el siguiente codigo pero quiero que en el select dependiendo del que escoja muestre otra tabla tendria que crear otras tablas sql o no se ayuda plzzzzz

Código HTML:
Ver original
  1. <div align="center" style="color:#ffffff;" class="rowElem">
  2. <b>Selecciona Un Modo Para Visualizar tus Datos:</b> <select name="modo" style="margin-top:80PX;" id="select">
  3.         <option value="uno"></option>
  4.         <option value="dos">Desarrollo</option>
  5.         <option value="tres">Fidelizacion</option>
  6.         <option value="cuatro">Prevencion</option>        
  7.         <option value="cinco">Contrato Movil</option>
  8.         <option value="seis">Prevencion Movil</option  >    
  9.         <option value=""></option>        
  10.     </select>
  11.     </div>


Código PHP:
Ver original
  1. <?php
  2. include ("config.php");
  3. mysql_connect($server, $db_user, $db_pass) or die (mysql_error());
  4. $result = mysql_query( "select * from kpi WHERE usuario = '$usuario'") or die (mysql_error());
  5.  
  6.    while ($qry = mysql_fetch_array($result)) {
  7.    
  8. echo "<table class='table2' style='margin-top:-430px;'>";
  9. echo "<thead>";
  10.                echo"     <tr>";
  11.                echo"<th scope='col' abbr='Deluxe'>KPIS</th>";
  12.                echo"          <th scope='col' abbr='Deluxe'>ENERO</th>";
  13.                echo"          <th scope='col' abbr='Deluxe'>FEBRERO</th>";
  14.                echo"          <th scope='col' abbr='Deluxe'>MARZO</th>";
  15.                echo"          <th scope='col' abbr='Deluxe'>ABRIL</th>";
  16.                echo"          <th scope='col' abbr='Deluxe'>MAYO</th>";
  17.                echo"          <th scope='col' abbr='Deluxe'>JUNIO</th>";
  18.                echo"          <th scope='col' abbr='Deluxe'>JULIO</th>";
  19.                echo"          <th scope='col' abbr='Deluxe'>AGOSTO</th>";
  20.                echo"          <th scope='col' abbr='Deluxe'>SEPTIEMBRE</th>";
  21.                echo"          <th scope='col' abbr='Deluxe'>OCTUBRE</th>";
  22.                echo"          <th scope='col' abbr='Deluxe'>NOVIEMBRE</th>";
  23.                echo"          <th scope='col' abbr='Deluxe'>DICIEMBRE</th>";
  24.                echo"      </tr>";
  25.                echo" </thead>";
  26.                echo"<tfoot>";
  27.                     echo"<tr>";
  28.                     echo"<th scope='row'><font color='#000'>Dentro de Objetivo?</font></th>";
  29.                     echo"<td><img src='objetivos/images/check0.png'/></td>";
  30.                     echo"<td></td>";
  31.                     echo"<td></td>";
  32.                     echo"<td></td>";
  33.                     echo"<td></td>";
  34.                     echo"<td></td>";
  35.                     echo"<td></td>";
  36.                     echo"<td></td>";
  37.                     echo"<td></td>";
  38.                     echo"<td></td>";
  39.                     echo"<td></td>";
  40.                     echo"<td></td>";
  41.                     echo"</tr>";
  42.                 echo"</tfoot>";
  43.                 echo"<tbody>";
  44.                     echo"<tr>";
  45.                         echo"<th scope='row'>LLAMADAS ATENDIDAS</th>";
  46.                         echo"<td>$qry[atendidas] </td>";
  47.                         echo"<td>$qry[fatendidas]</td>";
  48.                         echo"<td>$qry[matendidas]</td>";
  49.                         echo"<td>$qry[aatendidas]</td>";
  50.                         echo"<td>$qry[mmatendidas]</td>";
  51.                         echo"<td>$qry[jatendidas]</td>";
  52.                         echo"<td>$qry[jjatendidas]</td>";
  53.                         echo"<td>$qry[aaatendidas]</td>";
  54.                         echo"<td>$qry[satendidas]</td>";
  55.                         echo"<td>$qry[oatendidas]</td>";
  56.                         echo"<td>$qry[natendidas]</td>";
  57.                         echo"<td>$qry[datendidas]</td>";    echo"</tr>";                                                                                                               
  58.                 echo"</tbody>";
  59.             echo"</table>";
  60.             }
  61.             ?>
__________________
No hay Mayor señal de Ignoracia que creer imposible lo Inexplicable