marcaurel1984
Mitglied
Hallo,
ich möchte einfach nur 4 Daten in eine Tabelle einbauen, aber leider scheiters bei mir beim eintragen. er macht einfach nichts !?
könnt ihr mir dazu was sagen?
ich möchte einfach nur 4 Daten in eine Tabelle einbauen, aber leider scheiters bei mir beim eintragen. er macht einfach nichts !?
könnt ihr mir dazu was sagen?
PHP:
<?
include 'inc/config.php'; // Konfigurationsdatei laden
@mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());
mysql_select_db(MYSQL_DATABASE) OR die(mysql_error());
function eintragen ($titel, $text, $datum, $author)
{
if (mysql_query("INSERT INTO news (titel, text, datum, author) VALUES ('$titel','$text', Now(), 'author')"))
die('Fehler ! Der SQL-Befehl ist Falsch');
}
?>
<form name="form1" method="post" action="eintragen">
<table width="500" border="0">
<tr>
<td valign="top">Titel</td>
<td valign="top">
<input type="text" name="titel">
</td>
</tr>
<tr>
<td valign="top">Text </td>
<td valign="top">
<textarea name="text" wrap="VIRTUAL" cols="50" rows="10"></textarea>
</td>
</tr>
<tr>
<td valign="top">Author </td>
<td valign="top">
<input type="text" name="author">
</td>
</tr>
</table>
<input type="submit" name="eintragen" value="Eintragen">
<br>
<br>
</form>