Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/05/2013, 20:04
desoler
 
Fecha de Ingreso: agosto-2008
Ubicación: Miami, FL
Mensajes: 210
Antigüedad: 15 años, 8 meses
Puntos: 2
Pregunta fijar fila en consulta a mysql

Hola gente, a ver quien me puede echar una mano.
Genero un listado dentro de una tabla levantando los datos de Mysql y PHP.
Genero una primera fila con el nombre de las columnas y despues de while los resultados.
El tema es que necesito dejar fija la fila con los nombres de las columnas para que se pueda hacer scroll de los resultados, pero no logro hacerlo.
Se que debo utilizar position:fixed pero no puedo
este es el codigo que tengo:

Código PHP:
Ver original
  1. echo"
  2.  <table border=0 id=tabletitle cellspacing=0>
  3.    <tr class='spec'>
  4.      <th class='title'>Player Name</th>
  5.      <th class='title'>Prev. Owed</th>
  6.      <th class='title'>Court Rental</th>
  7.      <th class='title'>Pala Rental</th>
  8.      <th class='title'>Beberage</th>
  9.      <th class='title'>Lesson</th>
  10.      <th class='title'>Pala Sale</th>
  11.      <th class='title'> Balls</th>
  12.      <th class='title'>Overgrip</th>
  13.      <th class='title'>Food</th>
  14.      <th class='title'>Other</th>
  15.      <th class='title'>Total</th>
  16.      <th class='title2'>Paid</th>
  17.      <th class='title2'>Curr. Owed</th>
  18.    </tr>
  19.  </table>  
  20. ";
  21.  
  22. $results = $bd->query("SELECT * FROM playing_today ORDER by first_name ASC");  
  23.  
  24. while ($fila = $results->fetchArray()) {
  25.  
  26. echo"
  27.  <tr class='spec'>
  28.    <input style='display:none; type='checkbox' name='select[]' value='".$pa."'>
  29.    <input type='hidden' name='playing' value='no'>
  30.    <div id='btn_select'>
  31.      <a href='javascript:seleccionar_todo();close_day()'></a>
  32.    </div>
  33.    </form>
  34.    <form action='actualizar_player_price.php' method='POST'>
  35.    <input type='hidden' name='personalID_org' value='$pa'>
  36.    <td align=left width='170'>".$fn." ".$ln."</td>
  37.    <td align=center width='25'>".$po."</td>
  38.    <td align=center width='20'><input type='text' name='court_price' value='".$ct."' size=5 /></td>
  39.    <td align=center width='25'><input type='text' name='pala_rental_price' value='".$pr."' size=5 /></td>
  40.    <td align=center width='25'><input type='text' name='beberage_price' value='".$bb."' size=5 /></td>
  41.    <td align=center width='20'><input type='text' name='lesson_price' value='".$le."' size=5 /></td>
  42.    <td align=center width='20'><input type='text' name='pala_sale_price' value='".$ps."' size=5 /></td>
  43.    <td align=center width='15'><input type='text' name='balls_price' value='".$ba."' size=5 /></td>
  44.    <td align=center width='20'><input type='text' name='overgrip_price' value='".$og."' size=5 /></td>
  45.    <td align=center width='20'><input type='text' name='food_price' value='".$fo."' size=5 /></td>
  46.    <td align=center width='20'><input type='text' name='other' value='".$ot."' size=5 /></td>  
  47.    <td align=center width='20' style='color:red;'>";echo " ".$to." "; echo"
  48.    <td align=center width='20'><input type='text' name='paid' value='".$pd."' size=5 /></td>
  49.    <td align=center width='20' style='color:red;'>";echo " ".$co." "; echo"</td>
  50.    <input type='hidden' name='curr_owned' value='".$co."'>
  51.    <input type='hidden' name='prev_owed' value='".$po."'>
  52.    <input type='submit' style='visibility:hidden;' value='.'></form>
  53.    
  54. ";
  55. }
  56.  
  57. echo " <tr class='spec'>
  58.        <td align=center width='170'></td>
  59.        <td align=center width='20'>".$res_po."</td>
  60.        <td align=center width='20'>".$res_ct."</td>
  61.        <td align=center width='20'>".$res_pr."</td>
  62.        <td align=center width='20'>".$res_bb."</td>
  63.        <td align=center width='20'>".$res_le."</td>
  64.        <td align=center width='20'>".$res_ps."</td>
  65.        <td align=center width='20'>".$res_ba."</td>
  66.        <td align=center width='20'>".$res_og."</td>
  67.        <td align=center width='20'>".$res_fo."</td>
  68.        <td align=center width='20'>".$res_ot."</td>  
  69.        <td align=center width='20' style='color:red;'>".$res_sum."</td>
  70.        <td align=center width='20' style='color:blue;'>".$res_pd."</td>
  71.        <td align=center width='20' style='color:red;'>".$res_cow."</td>
  72.       </tr>
  73. ";
  74.  
  75.  
  76. echo "</tr></tabla>";

Desde ya, gracias por el tiempo prestado
__________________
Se invierte mas dinero en cirugía de pechos y viagra que en la cura del Alzheimer. En unos años tendremos viejas con grandes tetas y viejos con erecciones pero que no recordarán para que sirven..