Conseguir datos de una fila al apretar boton
Publicado por Francisco (3 intervenciones) el 05/11/2019 16:03:38
Tengo el siguiente código, y lo que necesito hacer, es tomar el valor de ciertas columnas especificas de la fila a la cual clickee el botón.
Saludos
Saludos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
include ("../conexion.php");
?>
<h1 align="center">Salida Productos </h1><br>
<table id="dtBasicExample" class="table table-striped table-bordered table-sm" cellspacing="0" width="100%">
<thead>
<tr>
<th class="th-sm">Codigo de barra
</th>
<th class="th-sm">Descripcion
</th>
<th class="th-sm">Stock</th>
<th>Cantidad
</th>
<th>Agregar
</th>
</tr>
</thead>
<tbody>
<?php
$selectproductos="SELECT *
FROM productos";
$contador=0;
$result=mysql_query($selectproductos,$conex);
while($ver=mysql_fetch_row($result)){
?>
<tr>
<td><?php $codigo= $ver[1]; echo $codigo; ?></td>
<td><?php $descripcion= $ver[2]; echo $descripcion; ?></td>
<td><?php $stock= $ver[3]; echo $stock; ?></td>
<td><input type="number" id="cantidadSalida" class="form-control" size="5" placeholder="Cantidad" aria-label="Username" aria-describedby="basic-addon1"></td>
<td>
<button class="btn btn-success" id="botonAgregar" >Agregar</button>
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th>Codigo de Barra
</th>
<th>Descripcion
</th>
<th>Stock
</th>
<th>Cantidad
</th>
<th>Agregar
</th>
</tr>
</tfoot>
</table>
Valora esta pregunta


0