I am trying to run this query
$query = "INSERT INTO breed_to_attribute (att_id,breed_id)
VALUES ( SELECT 'att_id','$id' FROM 'breed_to_attribute' WHERE 'breed_id' = '$template' )";
and keep getting this 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 'SELECT 'att_id','78' FROM 'breed_to_attribute' WHERE 'breed_id' = '71' )' at line 2
This is the basic mysql ststement, which runs fine in phpmyadmin
insert into breed_to_attribute
(att_id,breed_id)
select att_id,'77' FROM breed_to_attribute WHERE breed_id='71'
The query populates a new row with all the values from an existing row while changing the id.
What am I doing wrong? PHP does not seem to want to stop at the end of the query I guess or something.