Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/01/2014, 14:42
Avatar de adryan310
adryan310
 
Fecha de Ingreso: septiembre-2012
Mensajes: 450
Antigüedad: 11 años, 8 meses
Puntos: 3
Pregunta Crear una tabla dinamica con php?

Hola gente tengo el siguiente codigo que me crea unas filas dinamicamente:
Código PHP:
          $response "";
while(
$dataGames $strDataGames->fetch(PDO::FETCH_ASSOC)){
     
$response  "<tr>";
     
$response .= "<td>".$dataGames['Time']."</td>";
     
$response .= "<td>".$dataGames['NumGame']."</td>";
     
$response .= "<td>".$dataGames['Teams']."</td>";
         
$response .= "<td>".$dataGames['PeriodDescription']."</td>";
         
$response .= "<td>".$dataGames['Score']."</td>";
     
$response .= "<td>".$dataGames['Tickets']."</td>";
     
$response .= "<td>$".$dataGames['Risk']."</td>";
     
$response .= "<td>-275</td>";
     
$response .= "<td>-17517</td>";
     
$response .= "<td><a href='#' rel='".$_POST['value']."' onClick='openInfoAgent(this);'>".$_POST['value']."</a></td>";
         
$response .= "</tr>";    
}
         echo 
$response
Esto crea solo filas ya que $response es la respuesta que envio al ajax y en el ajax hago el append en la parte del tbody de la tabla correspondiente. Esto funciona bien, lo que pasa es que solo esta llegando la ultima fila que pasa por el while del php y necesito devolver todas las filas que se encuentren en la base de datos, el problemas esta en el while pero no se como solucionarlo, alguna ayuda please ???