INSERT INTO - Problem

dezz

Mitglied
Hallo,
ich will per INSERT INTO in meine Datenbank schreiben lassen. Leider klappt da irgendetwas nicht :(

HTML:
<form action="" method="post">
<table cellpadding="0"  >
<tr>
<tr><th align="left">Username: <input  name="usrname" type="text" maxlength="30"></th> </tr>
<tr><th align="left">Organization: <input  name="organisation" type="text"  maxlengt="100"></th> </tr>
<tr><th align="left">Vorname: <input name="fname" type="text"  maxlengt="100"></th>         </tr>
<tr><th align="left">Nachname: <input name="lname" type="text"  maxlengt="100"></th>    </tr>
<tr><th align="left">Domain: <input name="domain" type="text"  maxlengt="100"></th>    </tr>
<tr><th align="left">Email: <input name="email" type="text"  maxlengt="100"></th>      </tr>
<tr><th><input type="submit" name="submit" value="Submit"></th></tr>

</tr></table> </form>
PHP:
<?php
        error_reporting(E_ALL);

               $usr = $_POST["usrname"];
               $org = $_POST["organisation"];    
               $fname = $_POST["fname"];
               $lname = $_POST["lname"];
               $domain = $_POST["domain"];
               $email = $_POST["email"];
               $key = $_POST["key"];
        $usid = $_COOKIE["cook_first_one"];        

    
         if (isset($_POST["submit"]))

            {   
        
         $insertsel = "INSERT INTO user (username, organisation, firstname, lastname, email, domain, key) VALUES ('$usr', '$org', '$fname', '$lname', '$email', '$domain', '$key')";  
         $insert = mysql_query($insertsel, getdb());
         echo "Erfolgreich eingetragen!";
         

        
     }
     
if ( !$insert )
{
  die('Ungültige Abfrage: ' . mysql_error());
} ?>

Würde mich über jede Hilfe freuen!
 
Ändere mal folgende Zeile:

PHP:
$insert = mysql_query($insertsel, getdb());

in

PHP:
$insert = mysql_query($insertsel, getdb()) or die(mysql_error());
 
Zurück