please help me
it usually gives me error ( it says cant enter the values )

$host = "localhost";
$con = mysql_connect("localhost","awah","password") or die ("error to connect to the server");

// contact the table and enter the form
mysql_select_db("kigalifinders_clanteam_admin", $con);
$query = mysql_query("INSERT INTO contacts(from, subject, message) value('$_POST[email]','$_POST[subject]','$_POST[messgae]')");
die ("cant enter the values");

It should be:

INSERT INTO table (columns) VALUES (values)

instead of VALUE.

Hi, dear

Check this out!

$con = mysql_connect("localhost","awah","password");
if (!$con)
  die('Could not connect: ' . mysql_error());

mysql_select_db("my_db", $con);

$sql="INSERT INTO contacts (from, subject, message)

if (!mysql_query($sql,$con))
  die('Error: ' . mysql_error());
echo "1 record added";


Never mind.

now try this code is it working for you or not..

i have got this error

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from, subject, message) VALUES ('','what is wrong in this ' at line 1

Perhaps a single quote in the subject ?

Have u checked this script on any server... because same error. i think there is some bug in php version...

not exactly your values are coming correctly... still i m trying to resolve it..

Use word values insted of value in insert command

The problem is that "from" is a sql keyword. If you use a keyword as a column name, you need to encapsulate it. If you don't, sql will think you are asking for a query FROM a database.

Here is the correct syntax. INSERT INTO contacts (`from`, `subject`, `message`) VALUES ('{$_POST['email']}','{$_POST['subject']}','{$_POST['message']}')"; And it is good coding practice to encapsulate the other variables as well as I have show above.

All the best.