当前位置: 首页>>代码示例>>PHP>>正文


PHP WA_AB_generateWhereClause函数代码示例

本文整理汇总了PHP中WA_AB_generateWhereClause函数的典型用法代码示例。如果您正苦于以下问题:PHP WA_AB_generateWhereClause函数的具体用法?PHP WA_AB_generateWhereClause怎么用?PHP WA_AB_generateWhereClause使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了WA_AB_generateWhereClause函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: explode

    $WA_fieldValues = explode("|", $WA_fieldValuesStr);
    $WA_columns = explode("|", $WA_columnTypesStr);
    $WA_where_fieldValuesStr = "" . (isset($_POST["WADAUpdateRecordID"]) ? $_POST["WADAUpdateRecordID"] : "") . "";
    $WA_where_columnTypesStr = "none,none,NULL";
    $WA_where_comparisonStr = "=";
    $WA_where_fieldNames = explode("|", $WA_indexField);
    $WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
    $WA_where_columns = explode("|", $WA_where_columnTypesStr);
    $WA_where_comparisons = explode("|", $WA_where_comparisonStr);
    $WA_connectionDB = $database_connDB;
    mysql_select_db($WA_connectionDB, $WA_connection);
    if (!session_id()) {
        session_start();
    }
    $updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
    $WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons);
    $WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
    $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
    if ($WA_redirectURL != "") {
        if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
            $WA_redirectURL .= (strpos($WA_redirectURL, '?') === false ? "?" : "&") . $_SERVER["QUERY_STRING"];
        }
        header("Location: " . $WA_redirectURL);
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Update paypal_subscriptions</title>
开发者ID:Rhenan,项目名称:Email-Marketing,代码行数:31,代码来源:subscriptions-update.php

示例2: WA_AB_doManageRelationalTable

function WA_AB_doManageRelationalTable($WA_valuesList, $WA_appliedString, $WA_appliedList, $WA_connection, $WA_table, $WA_masterKeyField, $WA_masterKeyType, $WA_masterKeyValue, $WA_masterKeyComp, $WA_joinedKeyField, $WA_joinedKeyType, $WA_joinedKeyComp, $WA_fieldNamesStr, $WA_columnTypesStr)
{
    global $WA_AB_Split;
    $WA_fieldNames = explode("|", $WA_fieldNamesStr);
    $WA_columns = explode("|", $WA_columnTypesStr);
    $WA_formerString = "";
    $WA_formerList = array();
    $WA_insertIDs = "";
    $WhereObj = WA_AB_generateWhereClause(array($WA_masterKeyField), array($WA_masterKeyType), array($WA_masterKeyValue), array($WA_masterKeyComp));
    $WA_Sql = "SELECT " . $WA_masterKeyField . ", " . $WA_joinedKeyField . " FROM " . $WA_table . " WHERE " . $WhereObj->sqlWhereClause . " ORDER BY " . $WA_joinedKeyField;
    $WA_mrtJoinRS = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
    if (mysql_num_rows($WA_mrtJoinRS) > 0) {
        while ($row_WA_mrtJoinRS = mysql_fetch_assoc($WA_mrtJoinRS)) {
            $WA_formerString .= "^" . $row_WA_mrtJoinRS[$WA_joinedKeyField] . "^";
            $WA_formerList[] = $row_WA_mrtJoinRS[$WA_joinedKeyField];
        }
    }
    for ($n = 0; $n < sizeof($WA_formerList); $n++) {
        if (strpos($WA_appliedString, "^" . $WA_formerList[$n] . "^") === false) {
            $deleteParamsObj = WA_AB_generateWhereClause(array($WA_masterKeyField, $WA_joinedKeyField), array($WA_masterKeyType, $WA_joinedKeyType), array($WA_masterKeyValue, $WA_formerList[$n]), array($WA_masterKeyComp, $WA_joinedKeyComp));
            $WA_Sql = "DELETE FROM `" . $WA_table . "` WHERE " . $deleteParamsObj->sqlWhereClause;
            $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
        }
    }
    for ($n = 0; $n < sizeof($WA_appliedList); $n++) {
        if (strpos($WA_formerString, "^" . $WA_appliedList[$n] . "^") === false) {
            $WA_insertIDs .= "^" . $WA_appliedList[$n] . "^";
        }
    }
    for ($n = 0; $n < sizeof($WA_valuesList); $n++) {
        $WA_fieldValues = explode($WA_AB_Split, str_replace("^MASTERID^", $WA_masterKeyValue, str_replace("^JOINID^", $WA_valuesList[$n][0], $WA_valuesList[$n][1])));
        if (strpos($WA_insertIDs, "^" . $WA_valuesList[$n][0] . "^") === false) {
            if (str_replace("^MASTERID^", "", str_replace("^JOINID^", "", $WA_valuesList[$n][1])) != $WA_AB_Split) {
                $updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
                $WhereObj = WA_AB_generateWhereClause(array($WA_masterKeyField, $WA_joinedKeyField), array($WA_masterKeyType, $WA_joinedKeyType), array($WA_masterKeyValue, $WA_valuesList[$n][0]), array($WA_masterKeyComp, $WA_joinedKeyComp));
                $WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
                $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
            }
        } else {
            $insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
            $WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
            $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
        }
    }
}
开发者ID:JeisonSanchez,项目名称:LandingPT-Congre,代码行数:45,代码来源:wa_appbuilder_php.php

示例3: explode

    }
    $WA_keepQueryString = false;
    $WA_fieldNamesStr = "UserID";
    $WA_columnTypesStr = "',none,''";
    $WA_fieldValuesStr = "" . (isset($_POST["WADADeleteRecordID"]) ? $_POST["WADADeleteRecordID"] : "") . "";
    $WA_comparisonStr = "=";
    $WA_fieldNames = explode("|", $WA_fieldNamesStr);
    $WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
    $WA_columns = explode("|", $WA_columnTypesStr);
    $WA_comparisions = explode("|", $WA_comparisonStr);
    $WA_connectionDB = $database_bikes_db;
    mysql_select_db($WA_connectionDB, $WA_connection);
    if (!session_id()) {
        session_start();
    }
    $deleteParamsObj = WA_AB_generateWhereClause($WA_fieldNames, $WA_columns, $WA_fieldValues, $WA_comparisions);
    $WA_Sql = "DELETE FROM `" . $WA_table . "` WHERE " . $deleteParamsObj->sqlWhereClause;
    $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
    if ($WA_redirectURL != "") {
        if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
            $WA_redirectURL .= (strpos($WA_redirectURL, '?') === false ? "?" : "&") . $_SERVER["QUERY_STRING"];
        }
        header("Location: " . $WA_redirectURL);
    }
}
?>
<!DOCTYPE html>

<head>
<meta charset="utf-8">
<meta https-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
开发者ID:esquarenews,项目名称:MortgageBlog,代码行数:31,代码来源:index.php

示例4: processEvent

 function processEvent($isError)
 {
     if ($this->ToDo == "none") {
         return true;
     }
     if (sizeof($this->ColumnList) == 0) {
         return false;
     }
     $LogIncludeDirectory = getcwd();
     chdir(dirname(__FILE__));
     require "../../Connections/" . $this->Connection . ".php";
     if (!function_exists("WA_AB_generateInsertParams")) {
         require_once "../database_management/wa_appbuilder_php.php";
     }
     chdir($LogIncludeDirectory);
     eval("\$" . "logConnection = \$" . $this->Connection . ";");
     eval("\$" . "logDatabase = \$" . "database_" . $this->Connection . ";");
     mysql_select_db($logDatabase, $logConnection);
     $insertParams = WA_AB_generateInsertParams($this->ColumnList, $this->TypeList, $this->ValueList, -1);
     switch ($this->ToDo) {
         case "update":
             $emailToValue = "";
             $emailToType = "',none,''";
             for ($n = 0; $n < sizeof($this->ColumnList); $n++) {
                 if ($this->ColumnList[$n] == $this->EmailColumn) {
                     $emailToValue = $this->ValueList[$n];
                     $emailToType = $this->TypeList[$n];
                     break;
                 }
             }
             if (!$emailToValue && isset($_SESSION[$this->MailRef . "_To"])) {
                 $emailToValue = $_SESSION[$this->MailRef . "_To"];
             }
             if ($emailToValue) {
                 $toArrUpdate = WA_getEmailArray($emailToValue);
                 $emailToValue = $toArrUpdate[0][1];
                 if ($emailToValue) {
                     //check to see if record exists then update / insert as needed
                     $whereClause = WA_AB_generateWhereClause(array($this->EmailColumn), array($emailToType), array($emailToValue), array("="));
                     //$logUpdateTest = mysql_query("SELECT ".WA_AB_cleanUpColumnName($this->EmailColumn)." FROM ".WA_AB_cleanUpColumnName($this->TableName)." WHERE ".$whereClause->sqlWhereClause, $logConnection) or die(mysql_error());
                     //if (mysql_num_rows($logUpdateTest) > 0) {
                     //do update
                     $logUpdate = mysql_query("UPDATE " . WA_AB_cleanUpColumnName($this->TableName) . " SET " . $insertParams->WA_setValues . " WHERE " . $whereClause->sqlWhereClause, $logConnection) or die(mysql_error());
                     //break;
                     //}
                 }
             }
             //mysql_free_result($logUpdateTest);
             break;
         case "create":
             //create email_log table in database (if it doesn't exist) and insert
             //creation handled by UI
             //break; // do not break, continue to insert
         //create email_log table in database (if it doesn't exist) and insert
         //creation handled by UI
         //break; // do not break, continue to insert
         case "insert":
             //insert record to table
             $logInsert = mysql_query("INSERT INTO " . WA_AB_cleanUpColumnName($this->TableName) . " (" . $insertParams->WA_tableValues . ") VALUES (" . $insertParams->WA_dbValues . ")", $logConnection) or die(mysql_error());
             break;
     }
     return true;
 }
开发者ID:Mayoh,项目名称:grupo-ha,代码行数:63,代码来源:mailformatting_php.php


注:本文中的WA_AB_generateWhereClause函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。