Reputation: 21
$SQL="INSERT INTO first_name VALUES (fname) SELECT first_name FROM people WHERE fname = '$fname'";
I'm trying to insert the value 'fname' which is $fname (variable defined by a user) into the column 'first_name'
It's not adding anything but not displaying any errors. Syntax problem?
Upvotes: 0
Views: 46
Reputation: 263933
you don't need VALUES()
here
INSERT INTO first_name
SELECT first_name
FROM people WHERE fname = '$fname'
Upvotes: 2