本文整理汇总了PHP中DBManager::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP DBManager::execute方法的具体用法?PHP DBManager::execute怎么用?PHP DBManager::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager::execute方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addFeedbackFrom
function addFeedbackFrom($user, $value)
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
define_tables();
defineFeedbackColumns();
$table = Query::getDBSchema()->getTable(TABLE_FEEDBACK);
$db->execute($s = Query::generateInsertStm($table, array(FEEDBACK_CREATOR => $user->getID(), FEEDBACK_SUBJECT => $this->getID(), FEEDBACK_VALUE => $value ? 1 : 0)), $table->getName(), $this);
if ($db->affected_rows() != 1) {
$db->display_error("User::addFeedbackFrom()");
}
//Genera un errore ma ritorna comunque $this
} else {
$db->display_connect_error("User::addFeedbackFrom()");
}
return $this->loadFeedback();
}
示例2: createTag
/**
* Crea un tag.
* @param string $tag
* @return TRUE se il tag è stato creato, FALSE altrimenti.
*/
static function createTag($tag)
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
define_tables();
defineTagColumns();
$table = Query::getDBSchema()->getTable(TABLE_TAG);
$data = array(TAG_NAME => $tag);
$db->execute($s = Query::generateInsertStm($table, $data), $table->getName(), $tag);
if ($db->affected_rows() == 1) {
return true;
} else {
return false;
}
} else {
$db->display_connect_error("TagManager::createTag()");
}
}
示例3: searchPostsBy
private static function searchPostsBy($keys, $options, $echo_query = false)
{
require_once "query.php";
require_once "strings/strings.php";
define_tables();
definePostColumns();
$table = Query::getDBSchema()->getTable(TABLE_POST);
$loadComments = true;
$wheres = array();
foreach ($keys as $key => $value) {
if ($key == "name" || $key == "title") {
$wheres[] = new WhereConstraint($table->getColumn(POST_TITLE), Operator::LIKE, "%" . Filter::filterText($value) . "%");
}
if ($key == "permalink") {
$wheres[] = new WhereConstraint($table->getColumn(POST_PERMALINK), Operator::EQUAL, intval($value));
}
if ($key == "id") {
$wheres[] = new WhereConstraint($table->getColumn(POST_ID), Operator::EQUAL, intval($value));
}
if ($key == "tag") {
$wheres[] = new WhereConstraint($table->getColumn(POST_TAGS), Operator::LIKE, "%" . Filter::filterText($value) . "%");
}
if ($key == "day") {
if (!is_numeric($value)) {
$value = date_timestamp_get(date_create_from_format("Y-m-d", $value));
}
$daystart = date("Y-m-d", $value);
$dayend = date("Y-m-d", $value + 24 * 60 * 60);
//echo "<br />" . $daystart . "-" . $dayend; //DEBUG
$wheres[] = new WhereConstraint($table->getColumn(POST_CREATION_DATE), Operator::GREATEROREQUAL, $daystart);
$wheres[] = new WhereConstraint($table->getColumn(POST_CREATION_DATE), Operator::LESSER, $dayend);
}
if ($key == "category") {
$wheres[] = new WhereConstraint($table->getColumn(POST_CATEGORIES), Operator::LIKE, "%" . Filter::filterText($value) . "%");
}
if ($key == "title") {
$wheres[] = new WhereConstraint($table->getColumn(POST_TITLE), Operator::LIKE, "%" . Filter::filterText($value) . "%");
}
if ($key == "content") {
$wheres[] = new WhereConstraint($table->getColumn(POST_CONTENT), Operator::LIKE, "%" . Filter::filterText($value) . "%");
}
if ($key == "author") {
$wheres[] = new WhereConstraint($table->getColumn(POST_AUTHOR), Operator::EQUAL, intval($value));
}
if ($key == "no_id") {
$wheres[] = new WhereConstraint($table->getColumn(POST_ID), Operator::NOTEQUAL, intval($value));
}
if ($key == "loadComments") {
$loadComments = $value == true;
}
}
$newopt = array();
foreach ($options as $key => $value) {
if ($key == "by") {
if (!is_array($value)) {
$value = array($value);
}
$newvalue = array();
foreach ($value as $column) {
if (!is_a($column, "Column")) {
$column = $table->getColumn($column);
}
if (!is_null($column)) {
$newvalue[] = $column;
}
}
$value = $newvalue;
}
$newopt[$key] = $value;
}
$db = new DBManager();
$db->execute($s = Query::generateSelectStm(array($table), array(), $wheres, $newopt));
if ($echo_query) {
echo "<font color='red'>" . $s . "</font>";
}
//DEBUG
$posts = array();
while ($row = $db->fetch_result()) {
require_once "post/Post.php";
$posts[] = Post::createFromDBResult($row, $loadComments);
}
return $posts;
}
示例4: getAccessCount
/**
* @deprecated
* Enter description here ...
* @param unknown_type $type
* @param unknown_type $id
*/
static function getAccessCount($type, $id)
{
if ($type == null || $type == "" || $id == null) {
return 0;
}
$db = new DBManager();
if (!$db->connect_errno()) {
define_tables();
defineLogColumns();
$table = Query::getDBSchema()->getTable("AccessLog");
$exists = false;
if ($type == "Post") {
require_once 'post/PostManager.php';
return 0;
$exists = PostManager::postExists($id);
} else {
if ($type == "User") {
require_once 'user/UserManager.php';
return 0;
$exists = UserManager::userExists($id);
} elseif ($type == "Partner") {
//TODO: implementa Partner
// require_once 'post/PartnerManager.php';
// $exists = PartnerManager::partnerExists($id);
}
}
if ($exists) {
$wheres = array(new WhereConstraint($table->getColumn("alog_type"), Operator::EQUAL, $type), new WhereConstraint($table->getColumn("alog_id"), Operator::EQUAL, $id));
$db->execute($s = Query::generateSelectStm(array($table), array(), $wheres, array()));
if ($db->num_rows() == 1) {
$row = $db->fetch_result();
$data = array("alog_count" => ++$row["alog_count"]);
$db->execute($s = Query::generateUpdateStm($table, $data, $wheres), null, LOGMANAGER);
if ($db->affected_rows() == 1) {
return $row["alog_count"];
}
} else {
$data = array("alog_type" => $type, "alog_id" => $id);
$db->execute($s = Query::generateInsertStm($table, $data));
if ($db->affected_rows() == 1) {
}
return 1;
}
}
return 0;
}
}
示例5: loadFeedback
function loadFeedback()
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
define_tables();
defineFeedbackColumns();
$table = Query::getDBSchema()->getTable(TABLE_FEEDBACK);
$db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(FEEDBACK_SUBJECT), Operator::EQUAL, $this->getID())), array()));
if ($db->num_rows() > 0) {
require_once "strings/strings.php";
$fb = FEEDBACK_INITIAL_VALUE;
while ($row = $db->fetch_result()) {
$fb += intval($row[FEEDBACK_VALUE]) > 0 ? 1 : -1;
//se sul DB è 0 allora è -1 se è positivo allora +1;
}
return $this->setFeedback($fb);
} else {
if ($db->errno()) {
$db->display_error("User::loadFeedback()");
}
}
} else {
$db->display_connect_error("User::loadFeedback()");
}
return $this->setFeedback(FEEDBACK_INITIAL_VALUE);
}
示例6: loadMailsFromUser
static function loadMailsFromUser($user)
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
define_tables();
defineMailColumns();
$table = Query::getDBSchema()->getTable(TABLE_MAIL);
$db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(MAIL_FROM), Operator::EQUAL, $user)), array()), $table->getName(), $this);
//echo "<p>" . $s . "</p>"; //DEBUG
//echo "<p>" . $db->num_rows() . "</p>"; //DEBUG
if ($db->num_rows() == 1) {
// echo serialize(mysql_fetch_assoc($rs)); //DEBUG
$mails = array();
while ($row = $db->fetch_result()) {
$data = array("text" => $row[MAIL_TEXT], "subject" => $row[MAIL_SUBJECT], "from" => intval($row[MAIL_FROM]), "to" => $row[MAIL_TO], "repliesTo" => $row[MAIL_REPLIES_TO]);
$m = new Mail($data);
$m->setID(intval($row[MAIL_ID]))->setCreationDate(date_timestamp_get(date_create_from_format("Y-m-d G:i:s", $row[MAIL_CREATION_DATE])));
$mails[] = $m;
}
//echo "<p>" .$m ."</p>";
return $mails;
} else {
$db->display_error("Mail::loadMailsFromUser()");
}
} else {
$db->display_connect_error("Mail::loadMailsFromUser()");
}
return false;
}
示例7: loadReports
/**
* Carica in this i report recuperati dal database per questo post (deve avere un ID!).
*/
function loadReports()
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
define_tables();
defineReportColumns();
$table = Query::getDBSchema()->getTable(TABLE_REPORT);
$rs = $db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(REPORT_POST), Operator::EQUAL, $this->getID())), array()), $table->getName(), $this);
if ($rs !== false) {
$reports = array();
while ($row = $db->fetch_result()) {
require_once "common.php";
$report = new Report(intval($row[REPORT_USER]), intval($row[REPORT_POST]), $row[REPORT_TEXT]);
$report->setID($row[REPORT_ID]);
$reports[] = $report;
}
$this->setReports($reports);
} else {
if ($db->errno()) {
$db->display_error("Post::loadReports()");
}
}
} else {
$db->display_connect_error("Post::loadReports()");
}
return $this;
}
示例8: loadWinners
function loadWinners()
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
$table = Query::getDBSchema()->getTable(TABLE_CONTEST_SUBSCRIBER);
$rs = $db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(CONTEST_SUBSCRIBER_CONTEST), Operator::EQUAL, $this->getID()), new WhereConstraint($table->getColumn(CONTEST_SUBSCRIBER_PLACEMENT), Operator::GREATER, 0)), array()), $table->getName(), $this);
//echo "<p>" . $s . "</p>"; //DEBUG;
//echo "<p>" . mysql_num_rows($rs) . "</p>"; //DEBUG;
if ($db->num_rows() > 0) {
$win = array();
while ($row = $db->fetch_result()) {
$win[$row[CONTEST_SUBSCRIBER_PLACEMENT]] = $row[CONTEST_SUBSCRIBER_POST];
// Con in cs_winner il numero di posizione
//$win[] = $row[CONTEST_SUBSCRIBER_POST]; // Con in cs_winner true o false
}
$this->setWinners($win);
} else {
if ($db->errno()) {
$db->display_error("Contest::loadWinners()");
}
}
} else {
$db->display_connect_error("Contest::loadWinners()");
}
return $this;
}
示例9: DBManager
require_once "strings/" . LANG . "strings.php";
require_once "strings/strings.php";
require_once "query.php";
// $mysqli = @new MySQLi(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, "", DB_PORT);
// if(!$mysqli->select_db(DB_NAME)) {
// $mysqli->query("CREATE DATABASE " . DB_NAME);
// echo "<p>DATABASE CREATED</p>";
// } else
// echo "<p>DATABASE ALREADY EXISTED</p>";
//
// $mysqli->close();
$db = new DBManager();
require_once "db.php";
$queries = explode("\n\n", $s);
for ($i = 0; $i < count($queries); $i++) {
$db->execute($queries[$i], null, LOGMANAGER);
if ($db->result) {
$ss = explode("`", $queries[$i]);
echo "<p>TABLE " . $ss[1] . " INSTALLED</p>";
} else {
//DEBUG
$s = str_replace(",", ",<br />", $queries[$i]);
$s = str_replace(") ENGINE", ")<br />ENGINE", $s);
echo $s;
//DEBUG
echo $db->display_error("Install.php");
}
}
$db->execute("INSERT INTO `Role` VALUES('admin')", "Role", null);
$ra = $db->affected_rows();
$db->execute("INSERT INTO `Role` VALUES('user')", "Role", null);
示例10: addFollower
function addFollower($user)
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
define_tables();
defineFollowColumns();
$table = Query::getDBSchema()->getTable(TABLE_FOLLOW);
$db->execute($s = Query::generateInsertStm($table, array(FOLLOW_FOLLOWER => $user->getID(), FOLLOW_SUBJECT => $this->getID())), $table->getName(), $this);
if ($db->affected_rows() != 1) {
$db->display_error("User::addFollower()");
}
//Genera un errore ma ritorna comunque $this
} else {
$db->display_connect_error("User::addFollower()");
}
return $this->loadFollowers();
}
示例11: loadFromDatabase
/**
* Crea un voto caricando i dati dal database.
* È come fare una ricerca sul database e poi fare new Vote().
*
* @param $id: l'ID del voto da caricare.
* @return: il voto caricato o FALSE se non lo trova.
*/
static function loadFromDatabase($author, $post)
{
require_once "query.php";
$db = new DBManager();
if (!$db->connect_errno()) {
require_once 'strings/strings.php';
define_tables();
defineVoteColumns();
$table = Query::getDBSchema()->getTable(TABLE_VOTE);
$rs = $db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(VOTE_AUTHOR), Operator::EQUAL, $author), new WhereConstraint($table->getColumn(VOTE_POST), Operator::EQUAL, $post)), array()), $table->getName(), null);
if ($db->num_rows() == 1) {
$row = $db->fetch_result();
$v = new Vote(intval($row[VOTE_AUTHOR]), intval($row[VOTE_POST]), $row[VOTE_VOTE] > 0);
$v->setCreationDate(date_timestamp_get(date_create_from_format("Y-m-d G:i:s", $row[VOTE_CREATION_DATE])));
return $v;
}
//else $db->display_error("Vote::loadFromDatabase()");
} else {
$db->display_connect_error("Vote::LoadFromDatabase()");
}
return false;
}
示例12: MySQLi
<?php
Session::initializeQueryCounter();
$mysqli = @new MySQLi(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, "", DB_PORT);
if (!$mysqli->select_db(DB_NAME)) {
$mysqli->query("CREATE DATABASE " . DB_NAME);
echo "<p>DATABASE CREATED</p>";
} else {
echo "<p>DATABASE ALREADY EXISTED</p>";
}
$mysqli->close();
$db = new DBManager();
require_once "db.php";
$queries = explode("\n\n", DB::getCreateQueries());
for ($i = 0; $i < count($queries); $i++) {
$db->execute($queries[$i], null, LOGMANAGER);
if ($db->result) {
$ss = explode("`", $queries[$i]);
echo "<p>TABLE " . $ss[1] . " INSTALLED</p>";
} else {
//DEBUG
$s = str_replace(",", ",<br />", $queries[$i]);
$s = str_replace(") ENGINE", ")<br />ENGINE", $s);
echo $s;
//DEBUG
echo $db->display_error("Install.php");
}
}
$s = "INSERT INTO `" . DB::TABLE_ROLE . "` \n\t\t(`" . DB::ROLE_NAME . "`, `" . DB::READ . "`, \n\t\t`" . DB::CREATE_NEWS . "`, `" . DB::EDIT_NEWS . "`, `" . DB::DELETE_NEWS . "`, \n\t\t`" . DB::CREATE_PHOTOREP . "`, `" . DB::EDIT_PHOTOREP . "`, `" . DB::DELETE_PHOTOREP . "`, \n\t\t`" . DB::CREATE_VIDEOREP . "`, `" . DB::EDIT_VIDEOREP . "`, `" . DB::DELETE_VIDEOREP . "`, \n\t\t`" . DB::CHANGE_VISIBILITY . "`, `" . DB::CREATE_LIST . "`, `" . DB::EDIT_LIST . "`, `" . DB::DELETE_LIST . "`, \n\t\t`" . DB::COMMENT . "`, `" . DB::DELETE_COMMENT . "`, `" . DB::VOTE . "`, `" . DB::FOLLOW . "`, \n\t\t`" . DB::STOP_FOLLOW . "`, `" . DB::CREATE_FEEDBACK . "`, `" . DB::DELETE_FEEDBACK . "`, \n\t\t`" . DB::SEND_MESSAGE . "`, `" . DB::CREATE_DIRECTORY . "`, `" . DB::EDIT_DIRECTORY . "`, `" . DB::DELETE_DIRECTORY . "`, \n\t\t`" . DB::MARK_AS_READ . "`, `" . DB::MOVE_MESSAGE . "`, `" . DB::EMPTY_RECYCLE_BIN . "`, \n\t\t`" . DB::CREATE_RESOURCE . "`, `" . DB::EDIT_RESOURCE . "`, `" . DB::DELETE_RESOURCE . "`, \n\t\t`" . DB::EDIT_PROFILE . "`, `" . DB::CREATE_CONTEST . "`, `" . DB::EDIT_CONTEST . "`, `" . DB::DELETE_CONTEST . "`, \n\t\t`" . DB::SUBSCRIBE . "`, `" . DB::UNSUBSCRIBE . "`, `" . DB::CREATE_USER . "`, `" . DB::DELETE_USER . "`, \n\t\t`" . DB::BLOCK_USER . "`, `" . DB::SUSPEND_USER . "`, `" . DB::SIGNAL . "`, \n\t\t`" . DB::CREATE_CATEGORY . "`, `" . DB::EDIT_CATEGORY . "`, `" . DB::DELETE_CATEGORY . "`, \n\t\t`" . DB::CREATE_TEMPLATE . "`, `" . DB::EDIT_TEMPLATE . "`, `" . DB::DELETE_TEMPLATE . "`, \n\t\t`" . DB::ADVANCED_TPL_MANAGER . "`, `" . DB::EDIT_OTHER_NEWS . "`, `" . DB::EDIT_OTHER_PHOTOREP . "`, \n\t\t`" . DB::EDIT_OTHER_VIDEOREP . "`, `" . DB::EDIT_OTHER_LIST . "`, `" . DB::EDIT_OTHER_PROFILE . "`, \n\t\t`" . DB::EDIT_OTHER_RESOURCE . "`, `" . DB::UNSUBSCRIBE_OTHER . "`, `" . DB::DELETE_OTHER_FEEDBACK . "`, \n\t\t`" . DB::HIDE_OTHER . "`, `" . DB::CREATE_OTHER_TEMPLATE . "`, `" . DB::EDIT_OTHER_TEMPLATE . "`, `" . DB::DELETE_OTHER_TEMPLATE . "`, \n\t\t`" . DB::REQUEST_SUSPEND . "`, `" . DB::REQUEST_BLOCK . "`, `" . DB::VIEW_MOD_DECISION . "`, \n\t\t`" . DB::V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