PHP Change Database in Foreach with button ...?

1

Code:

foreach ($conexion->query("SELECT * FROM asegurados.asegurados LIMIT 0,1000") as $row){ 
<td>
    <input type="submit" name="submit<?php echo $row[Id] ?>" value="Guardar" onclick = "<?php $query = "UPDATE asegurados.asegurados SET TelefonoV = '4123' WHERE Id = '$row[Id]' ";  if ($conexion->query($query) === TRUE) {echo "alert('ok $row[Id]')";}?>" > 
</td>

At the moment of clicking, I change the whole base with the number 4123 ... but the message pop comes out ok #ID

I already change the name of the button by name# or name#Id name="submit<?php echo $row[Id] ?>") I keep changing the whole column of TelefonoV. '

Will they have any solution to my problem?

    
asked by ArmandoCG 12.05.2018 в 03:49
source

0 answers