Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/01/2014, 10:33
charly_lpg
 
Fecha de Ingreso: octubre-2013
Mensajes: 56
Antigüedad: 10 años, 6 meses
Puntos: 1
tablas con datos desde un select

Hola a todos

estoy hacuiendo una tabla que tome datos de un select. tengo los siguientes codigos pero no me muestra ningun resultado


codigo de la funcion

<script>
function InsertData(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlht tp.responseText;
}
}
}
</script>
-------------------------------------------------------------------------------------------------

Codigo PHP


<?php
echo"<table width='990'>
<tr>
<th colspan='7'>TARJETAS DE CREDITO (En Desarrollo)</th>
</tr>
<tr>
<td width='150' class= 'subtit'>Cia Aerea</td>
<td width='150' class= 'subtit'>Tarjeta</td>
<td width='150' class= 'subtit'>Nro Comercio</td>
<td width='150' class= 'subtit' >Telefono</td>
<td width='130' class= 'subtit'>Tabla de Coeficientes</td>
<td width='130' class='subtit'>Calculador de Cuotas</td>
<td width='130' class='subtit'>Promociones sin Interes</td>
</tr>
<tr>
<td rowspan ='5'>
<select name='seltc' onchange='InsertData(this.value'>
<option value='0'>Selecione CIA</option>
<option value='JJ'>TAM - JJ</option>
<option value='PZ'>TAM MERCOSUR - PZ</option>
</select>
</td>
</tr>";
$q = intval($_GET['q']);
$sql = "SELECT DISTINCT nombre,comercio,telefono FROM coeficientes WHERE cia='".$q."' GROUP BY nombre ORDER BY nombre asc";
$res = mysqli_query($conn, $sql);
$row= mysqli_num_rows($res);
$ctr=$row;
while ($fila = mysqli_fetch_assoc($res)) {
echo"<tr>
<td id='txtHint'>".$fila['nombre']."</td>
<td id='txtHint'>".$fila['comercio']."</td>
<td id='txtHint'>".$fila['telefono']."</td>";


Desde ya muchas gracias por su colaboracion

Saludos y buen año para todos