本文整理汇总了PHP中Result::resetQueries方法的典型用法代码示例。如果您正苦于以下问题:PHP Result::resetQueries方法的具体用法?PHP Result::resetQueries怎么用?PHP Result::resetQueries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result::resetQueries方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertComment
public function insertComment($obj)
{
//----------------------------------------------------------
//init var
//----------------------------------------------------------
$resultObj = array_merge(array('returnQuery' => $returnQuery), $this->resultObj);
$chk = array("bool" => true, "traceID" => "insertComments");
//----------------------------------------------------------
$chk = GenFun::errorKey_CHK($obj['set'], array("comment", "content_id"));
//----------------------------------------------------------
if (!$chk['bool']) {
return $chk;
}
//----------------------------------------------------------
$obj['set']['comment'] = stripslashes($obj['set']['comment']);
//----------------------------------------------------------
$chk = InsertINTO::go("comments", array("comment" => $obj['set']['comment'], "accounts_id" => is_null(GlobalMas::$loggedIN) ? $this->guest_id : GlobalMas::$loggedIN['id'], 'reply_comments_id' => $obj['set']['reply_comments_id'], 'commentType' => $this->commentType, 'content_id' => $obj['set']['content_id']));
//----------------------------------------------------------
if ($chk['bool']) {
$comment_id = $chk['insert_id'];
}
//----------------------------------------------------------
if ($chk['bool']) {
$chk = Result::resetQueries();
}
//----------------------------------------------------------
//$setArr = array('reply_comments_id' => $obj['set']['reply_comments_id'], "comments_id" => $comment_id, "content_id" => $obj['set']['content_id']);
//----------------------------------------------------------
//if ($chk['bool']) $chk = InsertINTO::go($this->contentComments_tbl, $setArr, array('resetQueries' => true));
//----------------------------------------------------------
if ($chk['bool']) {
$chk = $this->_getComments(NULL, $comment_id);
}
//----------------------------------------------------------
return $chk;
}
示例2: getResult
public function getResult()
{
if (is_null($this->mysqli)) {
$this->mysqli = GlobalMas::$mysqli;
}
//----------------------------------------------------------
//init var
//----------------------------------------------------------
$chk = array("bool" => true, 'traceID' => "getResult");
$update = false;
//----------------------------------------------------------
if ($this->returnQuery) {
return $this->queryString;
}
//----------------------------------------------------------
$chk = GenFun::debugChk($chk, array("queryString" => $this->queryString));
//----------------------------------------------------------
$debug = GlobalMas::$debug;
//----------------------------------------------------------
if ($this->chkForQuery) {
$query_chk = Result::go("SELECT queries.result, queries.last_update FROM queries WHERE queries.query = '" . $this->mysqli->escape_string($this->queryString) . "'");
//------------------------------------------------------
if (sizeof($query_chk['result']) > 0) {
if (empty($query_chk['result'][0]['last_update']) || is_null($query_chk['result'][0]['last_update'])) {
$update = true;
}
if (!$update) {
$chk = json_decode($query_chk['result'][0]['result'], true);
//----------------------------------------------
$chk = self::debug_chk($chk);
//----------------------------------------------
return $chk;
}
}
}
//----------------------------------------------------------
$result = $this->multi ? $this->mysqli->multi_query($this->queryString) : $this->mysqli->query($this->queryString);
//----------------------------------------------------------
if (!$result) {
$chk['bool'] = false;
$chk['error'] = false;
$chk = GenFun::debugCHK($chk, array('message' => $this->mysqli->error));
if (strpos($chk['message'], "Duplicate") !== false) {
return $chk['duplicate'] = true;
}
}
//----------------------------------------------------------
if ($this->multi) {
$result = $this->getMultiQueryResult($result);
} else {
$result = $this->getSingleQueryResult($result);
//----------------------------------------------
if ($this->greaterZero) {
if (sizeof($result) == 0) {
$chk['bool'] = false;
}
}
}
$chk['result'] = $result;
//----------------------------------------------------------
$this->insert_id = $this->mysqli->insert_id;
$chk['insert_id'] = $this->insert_id;
//--------------------------------------------------
if ($this->chkForQuery) {
$queryString = $this->mysqli->real_escape_string($this->queryString);
$resultString = $this->mysqli->real_escape_string(json_encode($chk));
if (!$update) {
$query_chk = Result::go("INSERT INTO queries (query, result)\r\n\t\t\t\t SELECT * FROM (SELECT '" . $queryString . "', '" . $resultString . "') AS tmp\r\n\t\t\t\tWHERE NOT EXISTS (\r\n\t\t\t\t\tSELECT query FROM queries WHERE query = '" . $queryString . "'\r\n\t\t\t\t) LIMIT 1");
} else {
$query_chk = Result::go("UPDATE queries SET queries.query = '" . $queryString . "', queries.result = '" . $resultString . "', queries.last_update = NOW() WHERE queries.query = '" . $queryString . "'");
}
//----------------------------------------------
GlobalMas::$debug = $debug;
}
//------------------------------------------------------
$chk = self::debug_chk($chk);
//------------------------------------------------------
if ($this->resetQueries) {
$chk['resetQueries'] = Result::resetQueries();
}
//------------------------------------------------------
return $chk;
}
示例3: _agreeWith_comment
public function _agreeWith_comment($accounts_id, $comments_id, $agree = "1", $returnQuery = NULL)
{
$chk = GenFun::error_chk(array($accounts_id, $comments_id));
if ($chk['bool']) {
$chk = InsertINTO::go("agreeWith", array("accounts_id" => $accounts_id, "comments_id" => $comments_id, "agree" => $agree));
//----------------------------------------------------------
if ($chk['bool']) {
$chk = Result::resetQueries();
}
//----------------------------------------------------------
}
return $chk;
}
示例4: getResult
public function getResult()
{
//----------------------------------------------------------
//init var
//----------------------------------------------------------
$chk = array("bool" => true, 'traceID' => "getResult");
$update = false;
//----------------------------------------------------------
if ($this->returnQuery) {
return $this->queryString;
}
//----------------------------------------------------------
$chk = GenFun::debugChk($chk, array("queryString" => $this->queryString));
//----------------------------------------------------------
$debug = Constants::$debug;
//----------------------------------------------------------
if ($this->chkForQuery) {
$query_chk = Result::go("SELECT queries.result, queries.last_update FROM queries WHERE queries.query = '" . Constants::$mysqli->escape_string($this->queryString) . "'");
//------------------------------------------------------
if (sizeof($query_chk['result']) > 0) {
if (empty($query_chk['result'][0]['last_update']) || is_null($query_chk['result'][0]['last_update'])) {
$update = true;
}
if (!$update) {
$chk = json_decode($query_chk['result'][0]['result'], true);
//----------------------------------------------
$chk = self::debug_chk($chk);
//----------------------------------------------
return $chk;
}
}
}
//----------------------------------------------------------
$result = $multi ? Constants::$mysqli->multi_query($this->queryString) : Constants::$mysqli->query($this->queryString);
//----------------------------------------------------------
if ($result) {
$chk['bool'] = true;
$arr = array();
if ($result) {
//--------------------------------------------------
$this->insert_id = Constants::$mysqli->insert_id;
$chk['insert_id'] = $this->insert_id;
//--------------------------------------------------
if ($multi) {
$result = Constants::$mysqli->use_result();
}
//--------------------------------------------------
if ($result && is_object($result)) {
while ($row = $result->fetch_assoc()) {
array_push($arr, $row);
}
//----------------------------------------------
if ($this->greaterZero) {
if (sizeof($arr) == 0) {
$chk['bool'] = false;
}
}
//----------------------------------------------
$chk['result'] = $arr;
}
}
//Constants::$debug = false;
//--------------------------------------------------
if ($this->chkForQuery) {
$queryString = Constants::$mysqli->real_escape_string($this->queryString);
$resultString = Constants::$mysqli->real_escape_string(json_encode($chk));
if (!$update) {
$query_chk = Result::go("INSERT INTO queries (query, result)\n\t\t\t\t\t SELECT * FROM (SELECT '" . $queryString . "', '" . $resultString . "') AS tmp\n\t\t\t\t\tWHERE NOT EXISTS (\n\t\t\t\t\t\tSELECT query FROM queries WHERE query = '" . $queryString . "'\n\t\t\t\t\t) LIMIT 1");
} else {
$query_chk = Result::go("UPDATE queries SET queries.query = '" . $queryString . "', queries.result = '" . $resultString . "', queries.last_update = NOW() WHERE queries.query = '" . $queryString . "'");
}
//----------------------------------------------
Constants::$debug = $debug;
}
} else {
$chk['bool'] = false;
$chk['error'] = true;
$chk = GenFun::debugCHK($chk, array('message' => Constants::$mysqli->error));
if (strpos($chk['message'], "Duplicate") !== false) {
$chk['duplicate'] = true;
}
}
//------------------------------------------------------
$chk = self::debug_chk($chk);
//------------------------------------------------------
if ($this->resetQueries) {
$chk['resetQueries'] = Result::resetQueries();
}
//------------------------------------------------------
return $chk;
}