I want to use a value from one array as the key for another as part of a MySQL replace statement. I tried the code below but got a syntax error of
"Unexpected '[' expected ']'"
Can this be done and if so any help with the right syntax would bemuch appreciated.
$sql = "REPLACE INTO sections(IDENTIFIER, NAME, DESCRIPTION, SEQUENCE, INSTRUCTIONS, TIME_AVAILABLE, EXTERNAL_RESOURCE)
VALUES ('$currentline[$flippedheaders['IDENTIFIER']]', '$currentline[flippedheaders['NAME']]', '$currentline[flippedheaders['DESCRIPTION']]', $currentline[flippedheaders['SEQUENCE']], '$currentline[flippedheaders['INSTRUCTION']]', $currentline[flippedheaders['TIME_AVAILABLE']], '$currentline[flippedheaders['EXTERNAL_RESOURCE']]')";