thank u very much sir.
I hv correted as u told. But unfortunately there is another problem.
hope u will help me in this problem too
<< SQL ERROR: 1064. 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 'name, quantity, type, date ) VALUES ('', 'quantity', 'solid', '01'' at line 2 >>
<?php
session_start();
include("config.php");
$chemicalname = mysql_real_escape_string($_POST['chemical name']);
$quantity = mysql_real_escape_string($_POST['quantity']);
$type = mysql_real_escape_string($_POST['type']);
$date = mysql_real_escape_string($_POST['date']);
$qry_add = "INSERT INTO chemical
(chemical name, quantity, type, date )
VALUES ('$chemicalname', 'quantity', '$type', '$date') ";
$count = mysql_query("SELECT COUNT(chemical name) FROM chemical WHERE chemical name='$chemicalname'");
if($count==1)
{
echo "<font color=red> Duplicate Entry. Please Verify Chemical name </font>";
}
else
{
if($result=mysql_query($qry_add))
{
echo '<script language="javascript">';
echo 'alert("you have successfully added one Chemical!" );';
echo '</script>';
}
else
{
echo "<br><font color=red size=+1 >Problem in Adding !</font>" ;
echo "ERROR - unable to add new chemical!<br>";
$SQLError = "SQL ERROR: ".mysql_errno().". ".mysql_error()."<BR><BR>";
echo "$SQLError";
mysql_close();
}
}
?>