2 Replies Latest reply on Dec 19, 2008 12:54 PM by Selah29

    Syntax Error

    Selah29
      I've received the following syntax error:

      Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in line 33

      The message is easy to find via Google, but the reason for the error escapes me. Can you help?

      By the way .... removing lines 33-35 eliminates the error, but I need them. The variable 'Personal_ID' is passed via a URL and referenced within a recordset.

      Here's the offending code:

      <?php require_once('Connections/connSTM.php'); ?>
      <?php
      if (!function_exists("GetSQLValueString")) {
      function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_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;
      }
      }

      $P_ID_DeletePerson = "0";

      /* line below is number 33 in code - this comment inserted to help locate it for this posting */
      if (isset(Personal_ID)) {
      $P_ID_DeletePerson = Personal_ID;
      }

      mysql_select_db($database_connSTM, $connSTM);
      etc.