Zacznę od struktury tabeli. Mam w niej pola:
id, date, text1, text2, text3, author, status, opened
A oto formularz, z którego dane powinny (a nie są ) być dodawane do bazy:
echo '<form name="form" method="post" action="test.php?option=add_ok"> <table border="0" cellspacing="3" cellpadding="0" align="center"> <tr> <td class="uni_01">'; else echo '<input type="text" name="author" size="30" value='.$author.'>'; echo '</td> </tr> <tr> <td class="uni_01"> <input type="text" name="text1" size="30" value='.$text1.'> </td> </tr> <tr> <td class="uni_01"> <input type="text" name="text2" size="30" value='.$text2.'> </td> </tr> <tr> <td class="uni_01"> <input type="text" name="text3" size="30" value='.$text3.'> </tr> <tr> <td class="uni_01"> <input style="font-weight: bold;" type="submit" name="ok" value="dodaj"> <input type="reset" name="Reset" value="wyczyść"> </td> </tr> </table> </form>'; } $query = "INSERT INTO testowa VALUES(NULL, now(), '$text1', '$text2', '$text3', '$author', '1', '')"; mysql_query($query); if ($text1!='' && $author!='' && $text3!='') { mysql_query($query); } }
Niestety - dane z formularza nie są dodawane do bazy.... Bardzo proszę o pomoc...