Jump to content

Insert Foreign key to table


jpergega

Recommended Posts

Hi

My query is like this and is saying there is an syntax error near 'cusomter_id')}' what am I doing wrong here?

$query = "
INSERT INTO `imglib` (
`img_name`, `img_type`, `img_size`, `img`,`customer_id`
)
VALUES (
'{$name}', '{$mime}', {$size}, '{$data}','{SELECT(customer_id FROM customer WHERE customer_id='cusomter_id')}'
)";
Thanks
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...