please correct the syntax

$sql = "INSERT INTO products 
 WHERE cat_name = '".$_POST['cat_name']."'
 (cat_name,pro_name, file_name, manufacturer, manufacturers_code,detail,page_title,page_keywords,page_description,active,featured)
VALUES( '" . $_POST['cat_name'] . "','" . $_POST['pro_name'] . "','" . $_POST['file_name'] . "', '" .$_POST['manufacturer'] . "', '" .$_POST['manufacturers_code'] . "', '" .$_POST['detail'] . "','" .$_POST['page_title'] . "','" .$_POST['page_keywords'] . "','" .$_POST['page_description'] . "','" .$_POST['active'] . "','" .$_POST['featured'] . "' );";

this syntax have a 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 'WHERE cat_name = 'hfgh' (cat_name,pro_name, file_name, manufacturer, manufactu' at line 2 please help me

How do you expect the INSERT INTO should work with that WHERE clause ? Just remove line 2.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.