I have a MySQL insert query which needs to pull one data field from another table and I was wondering if this can be done with a select subquery
INSERT INTO resources
(
client_account_id,
date_time,
resource_name,
resource_description_id,
)
VALUES
(
{0},
'{1}',
'{2}',
{3},
)
and I need a select query to get the resource_description_id from another table
SELECT resource_description_id
FROM resource_descriptions
WHERE resource_description = '{0}'
I have seen examples for duplicating entire tables, but I'm not sure how this can be done when just one field is needed from another table and the other fields come from a form.
Thanks!