How can I make update of all showed form lines (no whole table) just by one click?
by this code is made update of only one line of form.
if(isset($_POST['update'])){
$UpraveneQuery = "UPDATE uctovnictvo SET meno='$_POST[meno]', datum='$_POST[datum]', obchod='$_POST[obchod]', druh='$_POST[druh]', cena='$_POST[cena]', Poznamka='$_POST[poznamka]' WHERE uct_id='$_POST[hidden]' "; //--------------
mysql_query($UpraveneQuery, $con);
};
Here are data I work with
$sql = "SELECT * FROM uctovnictvo WHERE meno IN ('" . implode('\', \'', $option_meno) . "') AND obchod IN ('" . implode('\', \'', $option_obchod) . "') AND druh IN ('" . implode('\', \'', $option_druh) . "') AND datum BETWEEN '$date_start' AND '$date_end' ORDER BY $order";
$mojeData = mysql_query($sql,$con) or die($sql."<br/><br/> Chyba 1 je:".mysql_error());//run query a ulozit to premennej
Here you can see form where u can make only one update per line (ulozit zmenu).
while($zaznam = mysql_fetch_array($mojeData)){
echo "<form action=index-4.php method=post>";
echo "<tr>";
echo "<td>" . "<input type=text name=meno value=" . $zaznam['meno'] . ">" . "</td>";
echo "<td>" . "<input type=date name=datum value=" . $zaznam['datum'] . ">" . "</td>";
echo "<td>" . "<input type=text name=obchod value=" . $zaznam['obchod'] . ">" . "</td>";
echo "<td>" . "<input type=text name=druh value=" . $zaznam['druh'] . ">" . "</td>";
echo "<td>" . "<input step=any type=number name=cena value=" . $zaznam['cena'] . ">" . "</td>";
echo "<td>" . "<input type=text name=poznamka value=" . $zaznam['poznamka'] . ">" . "</td>";
echo "<td>" . "<input type=hidden name=hidden value=" . $zaznam['uct_id'] . ">" . "</td>";
echo "<td>" . "<input type=text name=hidden value=" . $zaznam['uct_id'] . ">" . "</td>";
echo "<td>" . "<input type=submit name=update value='ulozit zmenu'" . ">" . "</td>";
echo "<td>" . "<input type=submit name=zmazat value=zmazat" . ">" . "</td>";
echo "</tr>";
echo "</form>";
}
Thank you