Guys iam new to php and iam doing project in php. this is my problem
Parse error: syntax error, unexpected T_STRING in F:\xampplite\htdocs\vidi\add_chemical_save.php on line 7 <<<<
this is my code
<?php
session_start();
include("config.php");
$chemical name = mysql_real_escape_string($_POST['chemical name']); // line 7
$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 ('$chemical name', 'quantity', '$type', '$date') ";
$count = mysql_query("SELECT COUNT(chemical name) FROM chemical WHERE chemical name='$chemical name'");
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 save new username and password!<br>";
$SQLError = "SQL ERROR: ".mysql_errno().". ".mysql_error()."<BR><BR>";
echo "$SQLError";
mysql_close();
}
echo " <a href= ' adduser.php ' > click here to add new user </a>" ; }}?>