![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is the following the correct syntax for a prepared statement to carry out an INSERT INSERT INTO publication_source ps ( person_id , publications_visible , use_repository , use_webpage , use_localdata , publications_webpage ) VALUES ( SELECT p.id FROM person p WHERE p.username = ? , ? , ? , ? , ? , ? ) |
#3
| |||
| |||
|
|
On 2011-08-03 15:39, David wrote: [...] Is the following the correct syntax for a prepared statement to carry out an INSERT INSERT INTO publication_source ps ( person_id , publications_visible , use_repository , use_webpage , use_localdata , publications_webpage ) VALUES ( SELECT p.id FROM person p WHERE p.username = ? , ? , ? , ? , ? , ? ) My guess is no. I would suggest: INSERT INTO publication_source ps ( ... ) SELECT p.id, ?, ?, ... FROM person p WHERE p.username = ? You will off course have to change the order of the parameters in your php code. |
|
INSERT INTO publication_source ( person_id |
|
(SELECT p.id FROM person p WHERE p.username = ?) |
![]() |
| Thread Tools | |
| Display Modes | |
| |