unexpected 'mysqli_real_escape_string'
hi.i have been able to connect to my application form.but when i try to save data,it keeps bringing this error:
Parse error: syntax error, unexpected 'mysqli_real_escape_string' (T_STRING) in /websites/123reg/LinuxPackage22/ng/it/_o/ngit.org.uk/public_html/applicationform.php on line 10.
this is how my code looks like:
<?php require_once('applicationform.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("GetSQLValueString") ? string mysqli_real_escape_string ( string $theValue) : mysqli_escape_string(string $theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
please help.