Ahoj, snazim se udelat vypis tabulky a pomoci Comboboxu upravit hodnotu a ulozit..
index.php
<?php
$conn = mysqli_connect('192.168.11.13','root',heslo','balikovna');
?>
<html><body>
<table border="1">
<?php
$books_query=mysqli_query($conn, "select * from balikovna");
while($books_rows=mysqli_fetch_array($books_query)){
?>
<tr>
<td><?php echo $books_rows['ID'] ; ?></td>
<td><?php echo $books_rows['dopravce'] ; ?></td>
<td><?php echo $books_rows['kod'] ; ?></td>
<td><a href="update.php<?php echo '?id='.$books_rows['ID']; ?>">Edit</a></td>
</tr>
<?php }?>
</table>
</body></html>
update.php
<?php
$conn = mysqli_connect('192.168.11.13','root','heslo','balikovna');
$id=$_GET['id'];
?>
<html><body>
<form method="post">
<table>
<?php $books_query=mysqli_query($conn,"select * from balikovna where ID='$id'");
$books_rows=mysqli_fetch_array($books_query);
?>
<select id="cmbMake" name="Make" >
<option value="0">Vyber dopravce</option>
<option value="1">Zásilkovna</option>
<option value="2">DPD</option>
<option value="3">Česka pošta</option>
<option value="4">GEIS</option>
<option value="5">WEDO</option>
</select>
<tr><td>Dopravce:</td><td><input type="text" name="TextBoxForTitle" value="<?php echo $books_rows['dopravce']; ?>"></td></tr>
<tr><td>PIN:</td><td><input type="text" name="TextBoxForTitle1" value="<?php echo $books_rows['kod']; ?>"></td></tr>
<tr><td></td><td><input type="submit" name="submit" value="save"></td></tr>
</table></form></body></html>
<?php
if (isset($_POST['submit'])){
$TitleVariable=$_POST['TextBoxForTitle'];
$TitleVariable1=$_POST['TextBoxForTitle1'];
mysqli_query($conn,"update balikovna set dopravce='$TitleVariable' where ID='$id'");
mysqli_query($conn,"update balikovna set kod='$TitleVariable1' where ID='$id'");
header('location:index.php');
}
?>
ale ani za boha nemuzu prijit na to jak udelat, aby pri vyberu polozky se mi tato polozka propsala do DB
Mohl bych nekoho poprosit o pomoc ?
Tak uz vyřešeno...