You're not executing any sql commands here, you are only constructing the string. This one is probably no good either:
'$con$data'. You should also use mysqli or PDO and construct that into a prepared statement. You only have to bind once for the variables affected, and in the loop extract the array offsets into the appropriate variables and execute the statement. This will substantially reduce the overhead on large batch insertions.
header('HTTP/1.1 420 Enhance Your Calm');