<?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;
}
}
$colname_rs_request = "-1";
if (isset($_SESSION['RequestName'])) {
$colname_rs_request = $_SESSION['RequestName'];
}
mysql_select_db($database_My_DB, $My_DB);
$query_rs_request = sprintf("SELECT * FROM Request WHERE RequestName = %s", GetSQLValueString($colname_rs_request, "text"));
$rs_request = mysql_query($query_rs_request, $My_DB) or die(mysql_error());
$row_rs_request = mysql_fetch_assoc($rs_request);
$totalRows_rs_request = mysql_num_rows($rs_request);
?> |