Unexpected T_string on line 23

Hi all

Please stop me pulling out what little hair I have left!!

I have checked and double checked the code attached but cannot find any missing semi-colons, quotes or brackets.

Can anyone see the error in this code?

<?php

include $_SERVER['DOCUMENT_ROOT'] . '\\360feedback\\includes\\includes.php';

if (isset($_GET['newuser']))
{
include 'userform.html.php';
exit ();
}

if(isset($_POST['firstname']))
{
$firstname = mysqli_real_escape_string($link, $_POST['firstname']);
$surname = mysqli_real_escape_string($link, $_POST['surname']);
$relation = mysqli_real_escape_string($link, $_POST['relation']);
$sql = 'INSERT INTO user SET
firstname = "' . $_POST['firstname'] . '",
surname = "' . $_POST['surname'] . '",
relation = "' . $_POST['relation'] . '";

if(!mysqli_query($link, $sql))
{
$error = 'Error adding user:' . mysqli_error($link);
include $_SERVER['DOCUMENT_ROOT'] . '\\360feedback\\includes\\error.html.php';
exit();
}
}
?>

That’s why for getting rid of such syntactical mistakes/errors, you can use some good PHP IDEs like Zend Studio, phpDesigner, etc.

It’s all so obvious now!!! lol

Cheers


$sql = 'INSERT INTO user SET 
firstname = "' . $_POST['firstname'] . '", 
surname = "' . $_POST['surname'] . '", 
relation = "' . $_POST['relation'] . '"'; 

Even the free jEdit will provide nice Syntax highlighting for PHP code.

If given the choice, however, I suggest Netbeans PHP. Fantastic piece of equipment, I hate coding without it now.