Im adding a row to a database using a form but I keep getting the following error
Cannot add or update a child row: a foreign key constraint fails (`gigs`.`gig`, CONSTRAINT `gig_ibfk_2` FOREIGN KEY (`act`) REFERENCES `act` (`id`))
I understand the problem, that the database can't add the form because it can't reference the table ACT_id
But when I add the act ID to the form it doesn't work, this is the php I have been using
$query=mysqli_query($conn,"insert into gig SET venue='$gigvenue', act='$actid', sname='$gigdescription', img='$bandimg', start='$gigstart'") or die(mysqli_error($conn));