當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBManager::errno方法代碼示例

本文整理匯總了PHP中DBManager::errno方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBManager::errno方法的具體用法?PHP DBManager::errno怎麽用?PHP DBManager::errno使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBManager的用法示例。


在下文中一共展示了DBManager::errno方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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);
 }
開發者ID:Esisto,項目名稱:IoEsisto,代碼行數:27,代碼來源:FeedbackDao.php

示例2: loadFollows

 function loadFollows()
 {
     require_once "query.php";
     $db = new DBManager();
     if (!$db->connect_errno()) {
         define_tables();
         defineFollowColumns();
         $table = Query::getDBSchema()->getTable(TABLE_FOLLOW);
         $db->execute($s = Query::generateSelectStm(array($table), array(), array(new WhereConstraint($table->getColumn(FOLLOW_FOLLOWER), Operator::EQUAL, $this->getID())), array()));
         if ($db->num_rows() > 0) {
             $fols = array();
             while ($row = $db->fetch_result()) {
                 define_tables();
                 defineFollowColumns();
                 $f = self::loadFromDatabase(intval($row[FOLLOW_SUBJECT]), false);
                 if ($f !== false) {
                     $fols[$f->getID()] = $f;
                 }
             }
             return $this->setFollows($fols);
         } else {
             if ($db->errno()) {
                 $db->display_error("User::loadFollows()");
             }
         }
     } else {
         $db->display_connect_error("User::loadFollows()");
     }
     return $this->setFollows(array());
 }
開發者ID:Esisto,項目名稱:IoEsisto,代碼行數:30,代碼來源:FollowDao.php

示例3: loadMails

 function loadMails()
 {
     require_once "query.php";
     $db = new DBManager();
     if (!$db->connect_errno()) {
         define_tables();
         defineMailColumns();
         defineMailInDirColumns();
         $table = Query::getDBSchema()->getTable(TABLE_MAIL_IN_DIRECTORY);
         $table1 = Query::getDBSchema()->getTable(TABLE_MAIL);
         //echo "<p>" . $table . "</p>"; //DEBUG
         $rs = $db->execute($s = Query::generateSelectStm(array($table, $table1), array(new JoinConstraint($table->getColumn(MAIL_IN_DIRECTORY_MAIL), $table1->getColumn(MAIL_ID))), array(new WhereConstraint($table->getColumn(MAIL_IN_DIRECTORY_DIRECTORY), Operator::EQUAL, $this->getID())), array()), $table->getName(), $this);
         //echo "<p>" . $s . "</p>"; //DEBUG
         //echo "<p>" . $db->num_rows() . "</p>"; //DEBUG
         $mails = array();
         if ($rs !== false && $db->num_rows() > 0) {
             while ($row = $db->fetch_result()) {
                 $m = new Mail(array("from" => $row[MAIL_FROM], "to" => $row[MAIL_TO], "text" => $row[MAIL_TEXT], "subject" => $row[MAIL_SUBJECT], "repliesTo" => $row[MAIL_REPLIES_TO]));
                 $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>" . serialize($q->hasNext()) ."</p>";
                 //echo count($mails) . "-" . $db->num_rows() . "/"; //DEBUG
             }
             //TODO salvare il read status
             if ($db->num_rows() == count($mails)) {
                 return $this->setMails($mails);
             } else {
                 $db->display_error("MailDirectory::loadMails()");
             }
         } else {
             if ($db->errno()) {
                 $db->display_error("MailDirectory::loadMails()");
             }
         }
     } else {
         $db->display_connect_error("MailDirectory::loadMails()");
     }
     return false;
 }
開發者ID:Esisto,項目名稱:IoEsisto,代碼行數:39,代碼來源:Mail.php

示例4: 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;
 }
開發者ID:Esisto,項目名稱:IoEsisto,代碼行數:31,代碼來源:Post.php

示例5: 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;
 }
開發者ID:Esisto,項目名稱:IoEsisto,代碼行數:27,代碼來源:Contest.php


注:本文中的DBManager::errno方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。