Hello, I am trying to update a table in MySQL with jQuery , with queries to PDO . Here I have the code that I do not know how to update:
while($registro2 = mysql_fetch_array($registro)){
$tabla = $tabla.'<tr>
<td>'.$registro2['nomb_prod'].'</td>
<td>'.$registro2['tipo_prod'].'</td>
<td>S/. '.$registro2['precio_unit'].'</td>
<td>S/. '.$registro2['precio_dist'].'</td>
<td>'.fechaNormal($registro2['fecha_reg']).'</td>
<td><a href="javascript:editarProducto('.$registro2['id_prod'].');" class="glyphicon glyphicon-edit"></a> <a href="javascript:eliminarProducto('.$registro2['id_prod'].');" class="glyphicon glyphicon-remove-circle"></a></td>
</tr>';
}
In my case it only occurs to me to do a fetchAll()
and a forEach
but I do not know if it would be fine.