Ale, jako, ani tve reseni neni spatne. Tak tam bude 20 radku. Hlavne, ze se v kodu vyznas, i v html.
Příspěvky odeslané z IP adresy 2001:718:2601:258:f834:d86b:40e9:1095...–
peter
peter
// https://www.php.net/…atements.php
Example #3 Less round trips using multi-INSERT SQL
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli("example.com", "user", "password", "database");
$mysqli->query("DROP TABLE IF EXISTS test");
$mysqli->query("CREATE TABLE test(id INT)");
$values = [1, 2, 3, 4];
$stmt = $mysqli->prepare("INSERT INTO test(id) VALUES (?), (?), (?), (?)");
$stmt->bind_param('iiii', ...$values);
$stmt->execute();
a ty uc muzes dat jako pole
<input type=checkbox name="uc[]" value=1>
<input type=checkbox name="uc[]" value=1>
//$_POST['uc'] = array() // $values = [1, 2, 3, 4]; je take array
Akorat, ze to u checkboxu teda neodesila nezaskrtle, takze by se
to muselo asi resit jinak. Ale, u textu by to melo projit.
<input type=text name="uc[]" value=1>
<input type=text name="uc[]" value=1>