I have made a while loop which displays all users in Ploegen from the database I made it output the text which is suppose to be hidden but im testing it a the moment. anyway it has to update only 1 row the text and id it displays on the page are correct but the update is always ID 1 while i change the option value alot and the valueid (name) always the same.
I have no idea how to make this work I tried as u see, hope u could explain.
I dont need feedback because the code aint good just need help with the issue.
<div class="content-module-main">
<?php if(isset($_POST['submit'])){
$idtje = $_POST['valueid'];
$valueid = $_POST['ploeg'];
$idtje = mysqli_real_escape_string($connect, $idtje);
$valueid = mysqli_real_escape_string($connect, $valueid);
//$go = "UPDATE `ploegen` SET `ploeg`='$id' where `id`='$valueid'";
//$go2 = mysqli_query($connect, $go);
echo "<di" . "v class=\"confirmation-box round\">Ploegentest var_dump($valueid); var_dump($idtje);</div>";
}
?>
<table>
<thead>
<tr>
<th>Ploeg</th>
<th>Naam</th>
<th>Tel</th>
<th>Gas of Elektra</th>
<th>Wijzig</th>
</tr>
</thead>
<tbody>
<tr>
<form method="post" action="home_ploegen_b.php">
<?php
$query = "SELECT naam, telefoonnummer, id, ploeg, gasofelektra FROM ploegen ORDER by naam DESC LIMIT 100";
if ($result = mysqli_query($connect, $query)) {
while ($get = mysqli_fetch_assoc($result)) {
echo"<tr><td><center>" . $get['ploeg'] . "</center></td>";
echo"<td>" . $get['naam'] . "</td>";
echo"<td>" . $get['telefoonnummer'] . "</td>";
echo"<td>" . $get['gasofelektra'] . "</td>";
echo"<td><center><input type=\"text\" name=\"valueid\" value=\"" . $get['naam'] . "\" /><select name=\"ploeg\">
<option value=\"1\">Ploeg 1</option>
<option value=\"2\">Ploeg 2</option>
<option value=\"3\">Ploeg 3</option>
<option value=\"4\">Ploeg 4</option>
<option value=\"5\">Ploeg 5</option>
<option value=\"6\">Ploeg 6</option>
<option value=\"7\">Ploeg 7</option>
<option value=\"8\">Ploeg 8</option>
<option value=\"9\">Ploeg 9</option>
<option value=\"10\">Ploeg 10</option>
</select><input type=\"submit\" name=\"submit\" value=\"UPDATE\"></center></td></tr>";
}
}
?> </td></form>
