相关疑难解决方法(0)

PHP - GetSQLValueString函数

我看到一个函数Ge​​tSQLValueString,我不知道它处理的是什么,有人可以给我一些想法吗?
谢谢

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 …
Run Code Online (Sandbox Code Playgroud)

php

4
推荐指数
1
解决办法
3万
查看次数

标签 统计

php ×1