marcus: SQL-Insert funktioniert nicht!!!

Beitrag lesen

Hallo!

Ein simplesGästebuch, aber es will und will die Daten aus dem Formular nicht in die Datenbank einfügen!

Eigentlich funktioniert alles andere, nur meine Zeile:
or die("Insert Failed:" . $query);
gibt mir immer "Insert Failed:INSERT INTO randelmanGB (name, mail, text, time) VALUES ('Peter', 'peter@mail.at', 'Der tolle Text', now() )" zurück!

sieht vielleicht irgendwer, warum?

danke!, marcus

mein code:

<html>
<head><title></title></head>
<body>

<?
if ($REQUEST_METHOD=='POST') {
   if ($name && $text ) {
      $query = "INSERT INTO randelmanGB (name, mail, text, time) VALUES ('$name', '$mail', '$text', now() )";
   @mysql_pconnect("xxx","xxx","xxx")
                   or die("Unable to connect to SQL server");
    // mysql_select_db("xxx") or die("Unable to select database");
    mysql_query($query) or die("Insert Failed:" . $query);
} }
if ($submission==0){

$query = "SELECT * FROM randelmanGB order by time DESC";
   @mysql_pconnect("xxx","xxx","xxx")
                   or die("Unable to connect to SQL server");
    mysql_select_db("xxx") or die("Unable to select database");
   $entries= mysql_query($query);
?> <a href="gb.php?submission=1">SIGN GUESTBOOK</a><br><br><?
   if ($entries) {
   while ($entry = mysql_fetch_assoc($entries))
   {
   ?>
         <br> name:<? echo $entry[name]; ?> <br>
      email:<a href="mailto:<? echo $entry[mail];?>"><? echo $entry[mail];?></a> <br>
      <? echo $entry[time]; ?>
      text:<i><? echo $entry[text]; ?></i> <br>
   <? }}
   else {echo "NO ENTRIES FOUND";}

} elseif($submission==1) { ?>

<form method="post">
name:<input type="Text" name="name" value="" size="20" maxlength="30"><br>
mail:<input type="Text" name="mail" value="" size="20" maxlength="30"><br>
text:<input type="Text" name="text" value="" size="20"><br>
<input type="Reset" name="reset" value="reset">
<input type="Submit" name="submit" value="send">
</form>

<? } ?>

</body>
</html>