Hello,
Im using phpmyadmin for a website i'm creating and have a question about a inserting values into foreign key.
Im able to select an image table id when event col in events table is value x i.e...
$event = "Partay";
$sql = "SELECT i.ImageID
FROM images i
INNER JOIN events e
ON i.eventID = e.eventID
WHERE e.event ='".$event."'";
This works for selecting images to display. However when i want to insert and image inner join doesnt seem to work the same.
$sql = "INSERT INTO images i (i.image, e.event)
INNER JOIN event e
ON i.eventID = e.eventID
VALUES ('".$content."','".$event."')";
-Im trying to insert image into images table and a new event into event table so that this new image belongs to this new event. -Also how would inserting work when inserting image with an existing event?
Any help would be good thank you.