This is the table i am trying to insert to
CREATE TABLE reklame(
id INT( 7 ) NOT NULL PRIMARY KEY AUTO_INCREMENT,
Kunde CHAR( 30 ) NOT NULL ,
Title CHAR( 30 ) NOT NULL
);
here's the php:
<?php
// SQL database Variables
$hostname="localhost";
$user="root";
$pass="pass";
$dbase="database";
// Connection to database
MySQL_connect("$hostname","$user","$pass")
or die ("Could not connect to MYSQL");
MySQL_select_db("$dbase") or die ("Could not connect select database");
//Assign contents to variables
$Kunde = $Post['Kunde'];
$Title = $Post['Title'];
$result = mysql_query($sql);
$sql = "INSERT INTO reklame(id, Kunde, Title) VALUES ('','$Kunde','$Title')
)";
//Code that checks if the statment executed properly and display the message
if ($result)
{
echo ("Kunde and Title have been added");
}
else
{
echo ("an error has occured");
}
//Close connection with MySQL
MySQL_close()
?>
The out put to the screen is "an error has occured"
what am i dong wrong?