N
namya
Guest
why is the insert statement not working? I am posting the values from a form and one of the value is stored in $type, where $type is a tablename. so to insert i use following statement but it doesnt work..
$sql="INSERT INTO $type(designid,cost,plating,colorstone)VALUES('$designid','$cws','silver','white') ";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
I get the following 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 '(designid,cost,plating,colorstone)VALUES('','','gold','white')' at line 1
thanks in advance..
$sql="INSERT INTO $type(designid,cost,plating,colorstone)VALUES('$designid','$cws','silver','white') ";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
I get the following 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 '(designid,cost,plating,colorstone)VALUES('','','gold','white')' at line 1
thanks in advance..