这好象弄SQL的东西吧if (!function_exists("GetSQLValueString")) { //判断函数是否存在,不存在的话执行下面的代码
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
//下面都是条件判断
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;//如果get_magic_quotes_gpc()这个函数存在就执行stripslashes($theValue),否则返回$theValue
  }  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
//判断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;
}
}这样对么?

解决方案 »

  1.   

    你自己写的吗???貌似是数据库SQL语句建立的东西。
      

  2.   

    if (PHP_VERSION < 6) 啥意思 ??需要判断php的版本吗  ???
      

  3.   

    检查如果php版本低于6的话,
    检查一下magic quotes gpc 是否被设置,
    如果是on的话,就去掉转义.
      

  4.   

    应该是得到sql的值,根据传入的值和类型判断