Mam 4 formularze oraz 4 tabele w mysql.
Ja wybieram formularz modul i wypełniam pola i klikam zapisz, to mi dodaje puste rekordy również w pozostałych tabelach w mysql.
[/PHP] Jak to rozwiązać ? [PHP]<?php $modul = $_POST['modul']; $number = $_POST['number']; $producent = $_POST['producent']; $power = $_POST['power']; $number1 = $_POST['number1']; $number2 = $_POST['number2']; $producent1 = $_POST['producent1']; $elektronika= $_POST['elektronika']; $number3 = $_POST['number3']; $zapytanie = "INSERT INTO `module` (`id`,`modul`,`number`,`producent`) VALUES ('','".$modul."','".$number."','".$producent."')"; if($info) { } else { } $zapytanie1 = "INSERT INTO `ac` (`id`,`power`,`number1`) VALUES ('','".$power."','".$number1."')"; if($info1) { } else { } $zapytanie2 = "INSERT INTO `plyty` (`id`,`number2`,`producent1`) VALUES ('','".$number2."','".$producent1."')"; if($info2) { } else { } $zapytanie3 = "INSERT INTO `small_electronics` (`id`,`number3`,`elektronika`) VALUES ('','".$elektronika."','".$number3."')"; if($info3) { } else { } ?>
<form action='form.php' method="POST"/> <table bgcolor="silver"> <tr> <td>Nazwa modulu: <br/><td><input type="text" name="modul" size="20"></td></td> </tr> <tr> <td>P/N: <br/><td><textarea name="number" cols="x" rows="y"></textarea></td></td> </tr> <tr> <td>Producent: <br/><td><input type="text" name="producent" size="20"></td></td> </tr> <tr> <td><button type="submit">dodaj modul</button></td> </tr> </table> </form>