本文整理汇总了PHP中GetSQLValueString函数的典型用法代码示例。如果您正苦于以下问题:PHP GetSQLValueString函数的具体用法?PHP GetSQLValueString怎么用?PHP GetSQLValueString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSQLValueString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createMainDataElement
function createMainDataElement($plan, $num, $dbConn)
{
if ($plan['dato_principal_' . $num] != NULL) {
$query_dato = sprintf("SELECT * FROM tipoDatosServicios WHERE id_tipoDato=%s", GetSQLValueString($plan['id_tipoDato_principal_' . $num], "int"));
$dato = mysql_query($query_dato, $dbConn) or die(mysql_error());
$row_dato = mysql_fetch_assoc($dato);
$display = true;
$label = "";
if ($row_dato['tipo'] == "boolean") {
if ($plan['dato_principal_' . $num] == "1") {
$label = $row_dato['label'];
} else {
$display = false;
}
} else {
if ($row_dato['display_label']) {
$label = $plan['dato_principal_' . $num] . " " . $row_dato['label'];
} else {
$label = $plan['dato_principal_' . $num];
}
}
if ($display) {
echo "<div class='dato'>";
echo "\t<li class='tipo_" . $plan['id_tipoDato_principal_' . $num] . "' value='" . $plan['dato_principal_' . $num] . "'>";
echo $label;
echo "\t</li>";
echo "</div>";
}
}
//if
}
示例2: ValidateNameExistAndClean
public static function ValidateNameExistAndClean($string)
{
$UserName = new \CmsDev\util\CheckUserName();
$stringValid = $UserName->Fix($string);
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$user = $SKTDB->get_row("SELECT username FROM users WHERE username = " . \GetSQLValueString($stringValid, 'text') . "");
if ($user) {
return 'exist';
} else {
return $stringValid;
}
}
示例3: record
function record($start_date, $end_date)
{
global $useradmin;
$start = new DateTime($start_date);
$end = new DateTime($end_date);
$end = $end->modify('+1 day');
$interval = new DateInterval('P1D');
$period = new DatePeriod($start, $interval, $end);
//var_dump($period);
foreach ($period as $date) {
$index_date = $date->format('Y-m-d');
//echo $index_date;
$unique_visitors = get_unique_visits($index_date);
$visits = get_visits($index_date);
$time = get_time($index_date);
echo "<br/><br/>" . $index_date . "<br/><br/>";
echo "unique visitors:" . $unique_visitors . "<br/>";
echo "visits:" . $visits . "<br/>";
echo "total time:" . $time . "<br/>";
$selectSQL = "SELECT * FROM visitor_daily_report WHERE report_date='" . $index_date . "'";
if ($row_record = mysql_fetch_assoc(mysql_query_or_die($selectSQL, $useradmin))) {
echo "<br/>record already in database!<br/>";
} else {
echo "<br/>inserting new record into database!<br/>";
$insertSQL = sprintf("INSERT INTO visitor_daily_report (report_date, visits, unique_visitors, total_time) VALUES(%s, %s, %s, %s)", GetSQLValueString($index_date, "date"), GetSQLValueString($visits, "int"), GetSQLValueString($unique_visitors, "int"), GetSQLValueString($time, "int"));
$result = mysql_query_or_die($insertSQL, $useradmin);
}
}
}
示例4: save
function save($user)
{
global $database_connMain, $connMain;
$insertSQL = sprintf("Replace google_auth set email = %s, gender = %s, name = %s, `uid` = %s, link = %s, picture = %s", GetSQLValueString($user['email'], "text"), GetSQLValueString($user['gender'], "text"), GetSQLValueString($user['name'], "text"), GetSQLValueString($user['id'], "text"), GetSQLValueString($user['link'], "text"), GetSQLValueString($user['picture'], "text"));
mysql_select_db($database_connMain, $connMain);
$Result1 = @mysql_query($insertSQL, $connMain);
if (empty($Result1)) {
throw new Exception(mysql_error());
}
}
示例5: insert_sysid
function insert_sysid($sysid)
{
global $useradmin;
$selectSQL = "SELECT * FROM sysid_raw_current WHERE sysid={$sysid}";
$get_sysid = mysql_query_or_die($selectSQL, $useradmin);
if ($row_get_sysid = mysql_fetch_assoc($get_sysid)) {
} else {
$insertSQL = sprintf("INSERT INTO sysid_raw_current (sysid) VALUES(%s)", GetSQLValueString($sysid, "int"));
$result = mysql_query_or_die($insertSQL, $useradmin);
}
}
示例6: nombre
function nombre($iduser)
{
global $database_conexion, $conexion;
mysql_select_db($database_conexion, $conexion);
$query_DatosFuncion = sprintf("SELECT user FROM z_users WHERE id=%s", GetSQLValueString($iduser, "int"));
$DatosFuncion = mysql_query($query_DatosFuncion, $conexion) or die(mysql_error());
$row_DatosFuncion = mysql_fetch_assoc($DatosFuncion);
$totalRows_DatosFuncion = mysql_num_rows($DatosFuncion);
return $row_DatosFuncion['user'];
mysql_free_result($DatosFuncion);
}
示例7: setParamsFromFile
private static function setParamsFromFile()
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$query = $SKTDB->get_results("SELECT * FROM language ORDER BY LanguageName ASC");
global $SKT;
foreach ($query as $language) {
include 'site/' . $language->Prefix . '.php';
$Setparams = $SKTDB->query(\sprintf("UPDATE language Set SiteParams = %s\r\n\t\tWHERE ID = %s", GetSQLValueString(json_encode($SKT), "text"), GetSQLValueString($language->ID, "int")));
//$MessageBox = SKT_INFO\Asistance::get();
//$MessageBox->TipOk('El archivo Language/site/' . $language->Prefix . '.php, fue cargado correctamente.', true);
}
//self::getParams();
}
示例8: get_nearby_cities
public function get_nearby_cities($lat, $lon, $radius = 30, $order = 'distance', $limit = 30)
{
global $connMainAdodb;
$connMainAdodb->Execute("SET NAMES utf8");
$sql = sprintf("select *, (ROUND(\n\tDEGREES(ACOS(SIN(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * SIN(RADIANS(c.latitude)) + COS(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * COS(RADIANS(c.latitude)) * COS(RADIANS(" . GetSQLValueString($lon, 'double') . " -(c.longitude)))))*60*1.1515,2)) as distance from geo_cities as c WHERE (ROUND(\n\tDEGREES(ACOS(SIN(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * SIN(RADIANS(c.latitude)) + COS(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * COS(RADIANS(c.latitude)) * COS(RADIANS(" . GetSQLValueString($lon, 'double') . " -(c.longitude)))))*60*1.1515,2)) <= " . GetSQLValueString($radius, 'int') . " ORDER BY " . $order . " LIMIT " . $limit);
$recordSet = $connMainAdodb->CacheExecute(_FUNC_TIME_DAY, $sql);
$return = array();
while (!$recordSet->EOF) {
$return['city_' . $recordSet->fields['cty_id']] = $recordSet->fields;
$recordSet->MoveNext();
}
return $return;
}
示例9: __construct
function __construct($user, $SERVER, $POST, $GET)
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$user = $user;
$url = !empty($SERVER['HTTPS']) ? "https://" . $SERVER['SERVER_NAME'] . $SERVER['REQUEST_URI'] : "http://" . $SERVER['SERVER_NAME'] . $SERVER['REQUEST_URI'];
$previousUrl = isset($SERVER['HTTP_REFERER']) ? $SERVER['HTTP_REFERER'] : '0';
$postData = json_encode($POST);
$now = date("Y-m-d H:i:s");
$product = isset($GET['DetailID']) ? $GET['DetailID'] : '';
$search = isset($GET['SearchQuery']) ? $GET['SearchQuery'] : '';
$query = "INSERT INTO userstep" . "(user, previous_page, url_query_string, post_param, date_time, product, search )" . "VALUES (" . GetSQLValueString($user, 'int') . "," . GetSQLValueString($previousUrl, 'text') . "," . GetSQLValueString($url, 'text') . "," . GetSQLValueString($postData, 'text') . "," . GetSQLValueString($now, 'text') . "," . GetSQLValueString($product, 'int') . "," . GetSQLValueString($search, 'text') . ")";
$insert = $SKTDB->query($query);
}
示例10: validateMD5
private function validateMD5($MD5 = 0)
{
$SKTDB = SKT_DB::connect();
$user = $SKTDB->get_row("SELECT * FROM users WHERE md5 = " . \GetSQLValueString($MD5, 'text') . "");
if ($user) {
$updateSectionImage = mysql_query(sprintf("UPDATE users Set \r\n\t\t\t\t\t\t\tisactive = %s\r\n\t\t\t\t\t\t\tWHERE md5 = %s", GetSQLValueString(1, "int"), GetSQLValueString($MD5, "text")));
return true;
} else {
$MessageBox = SKT_INFO\Asistance::get();
$MessageBox->TipError('No se pudo validar el usuario.<br>' . $MD5, true);
return false;
}
}
示例11: claveUsuario1
function claveUsuario1()
{
$usu = GetSQLValueString($_POST["usuario"], "text");
$respuesta = false;
$claveUsuario = -1;
$conexion = conectaBDSICLAB();
$consulta = sprintf("select * from lbusuarios where usuario=%s limit 1", $usu);
$res = mysql_query($consulta);
if ($row = mysql_fetch_array($res)) {
$respuesta = true;
$claveUsuario = $row["claveUsuario"];
}
$arrayJSON = array('respuesta' => $respuesta, 'claveUsuario' => $claveUsuario);
print json_encode($arrayJSON);
}
示例12: UserQuery
private static function UserQuery()
{
$SKTDB = SKT_DB::connect();
$USER_EXIST = \CmsDev\Security\loginIntent::action('validateUser');
if ($USER_EXIST === true) {
$user_row = $SKTDB->get_row("SELECT *\r\n FROM users as user, userprofile as profile \r\n WHERE user.md5 = " . \GetSQLValueString($_SESSION['login'], 'text') . " AND profile.IDX = user.id ");
if ($user_row) {
return $user_row;
} else {
return false;
}
} else {
return false;
}
}
示例13: insert_update_ranking
function insert_update_ranking($sysid, $ranking)
{
global $useradmin;
$selectSQL = "SELECT sysid FROM listing_ranking WHERE sysid={$sysid}";
$get_sysid = mysql_query_or_die($selectSQL, $useradmin);
if ($row_get_sysid = mysql_fetch_assoc($get_sysid)) {
echo "<br/>sysid" . $row_get_sysid['sysid'] . "is already in the database<br/>";
$updateSQL = sprintf("UPDATE listing_ranking SET ranking=%s WHERE sysid=%s", GetSQLValueString($ranking, "double"), GetSQLValueString($row_get_sysid['sysid'], "int"));
$result = mysql_query_or_die($updateSQL, $useradmin);
} else {
echo "<br/>{$sysid} is not in the database, inserting new record<br/>";
$insertSQL = sprintf("INSERT INTO listing_ranking (sysid, ranking) VALUES (%s, %s)", GetSQLValueString($sysid, "int"), GetSQLValueString($ranking, "double"));
$result = mysql_query_or_die($insertSQL, $useradmin);
}
}
示例14: get_nearby_cities
function get_nearby_cities($lat, $lon, $radius = 30, $order = 'distance', $limit = 30)
{
global $connMainAdodb;
$connMainAdodb->Execute("SET NAMES utf8");
$sql = sprintf("select c.*, co.name as country, s.name as state, (ROUND(\nDEGREES(ACOS(SIN(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * SIN(RADIANS(c.latitude)) + COS(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * COS(RADIANS(c.latitude)) * COS(RADIANS(" . GetSQLValueString($lon, 'double') . " -(c.longitude)))))*60*1.1515,2)) as distance from geo_cities as c LEFT JOIN geo_states as s ON c.sta_id = s.sta_id LEFT JOIN geo_countries as co ON c.con_id = co.con_id WHERE (ROUND(\nDEGREES(ACOS(SIN(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * SIN(RADIANS(c.latitude)) + COS(RADIANS(" . GetSQLValueString($lat, 'double') . ")) * COS(RADIANS(c.latitude)) * COS(RADIANS(" . GetSQLValueString($lon, 'double') . " -(c.longitude)))))*60*1.1515,2)) <= " . GetSQLValueString($radius, 'int') . " ORDER BY " . $order . " LIMIT " . $limit);
$recordSet = $connMainAdodb->Execute($sql);
$return = array();
$i = 0;
while (!$recordSet->EOF) {
$return[$i] = $recordSet->fields;
$return[$i]['location'] = $recordSet->fields['name'] . ', ' . $recordSet->fields['state'] . ', ' . $recordSet->fields['country'];
$i++;
$recordSet->MoveNext();
}
return $return;
}
示例15: loadAd
function loadAd($id_anuncio, $dbConn)
{
$query_ad = sprintf("SELECT * FROM anuncios where id_anuncio=%s", GetSQLValueString($id_anuncio, "int"));
$ad = mysql_query($query_ad, $dbConn) or die(mysql_error());
$row_ad = mysql_fetch_assoc($ad);
$totalRows_ad = mysql_num_rows($ad);
if ($totalRows_ad > 0) {
if ($row_ad['url'] != NULL) {
echo "<a href='" . $row_ad['url'] . "' target='_blank'>";
}
echo "<img src='uploads/anuncios/" . $row_ad['id_anuncio'] . "/" . $row_ad['imagen'] . "' />";
if ($row_ad['url'] != NULL) {
echo "</a>";
}
}
}