$query = "INSERT INTO members( name, email, location, registration_date) VALUES ( '$n', '$e','$ln', NOW() )";
$result = @ ($query); // Run the query.
if ($result) { // If it ran OK.
//////////////////////////////////////////
// write to text file
variables are defined in further up the script.
The values are being inserted into the members table, it only after when writing to the text file that I am having problems.