Yes, there are similar questions (i.e. PDO mysql: How to know if insert was successful and $stmt->execute() : How to know if db insert was successful?), however, the supplied answers don't seem to work for me.
Given the below query, $stmt->execute(array($doc_id,$id,$sites_id))
returns true
, however, a record is not inserted.
How do I determine whether PDO inserted a record?
EDIT. Please don't just say to use PDO::lastInsertId
, but if doing so is necessary, give a reason why it is necessary.
INSERT INTO docx_priv_projects (documents_id,projects_id)
SELECT 2972614382,t.id
FROM projects AS t INNER JOIN entities AS e ON e.id=t.id
WHERE t.id=1379519490 AND e.record_status='active' AND e.sites_id=2416619273;