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


PHP Connection::fetchArray方法代碼示例

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


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

示例1: load

 public function load($iGenreID)
 {
     $oCon = new Connection();
     $sSQL = "SELECT GenreID, GenreName, DisplayOrder \n\t\t\tFROM tbgenres \n\t\t\tWHERE GenreID = " . $iGenreID;
     $oResultSet = $oCon->query($sSQL);
     $aRow = $oCon->fetchArray($oResultSet);
     $this->iGenreID = $aRow['GenreID'];
     $this->sGenreName = $aRow['GenreName'];
     $this->iDisplayOrder = $aRow['DisplayOrder'];
     $sSQL = "SELECT RecordID\n\t\t\tFROM tbrecords \n\t\t\tWHERE GenreID = " . $iGenreID;
     $oResultSet = $oCon->query($sSQL);
     while ($aRow = $oCon->fetchArray($oResultSet)) {
         $iRecordID = $aRow["RecordID"];
         $oRecord = new Record();
         $oRecord->load($iRecordID);
         $this->aRecords[] = $oRecord;
     }
     $oCon->close();
 }
開發者ID:wasim01,項目名稱:theRecordBreakers,代碼行數:19,代碼來源:genre.php

示例2: load

 public function load($iCategoryID)
 {
     $oCon = new Connection();
     $sSQL = 'SELECT CategoryID,CategoryName,CategoryDesc,Active FROM tbcategory WHERE CategoryID=' . $iCategoryID;
     $oResultSet = $oCon->query($sSQL);
     $aRow = $oCon->fetchArray($oResultSet);
     $this->iCategoryID = $aRow['CategoryID'];
     $this->sCategoryName = $aRow['CategoryName'];
     $this->sCategoryDesc = $aRow['CategoryDesc'];
     $this->iActive = $aRow['Active'];
     $sSQL = 'SELECT TopicID FROM tbtopics WHERE CategoryID=' . $iCategoryID . ' AND Active = 1';
     $oResultSet = $oCon->query($sSQL);
     while ($aRow = $oCon->fetchArray($oResultSet)) {
         $iTopicID = $aRow['TopicID'];
         $oTopic = new Topic();
         $oTopic->load($iTopicID);
         $this->aTopics[] = $oTopic;
     }
     $oCon->close();
 }
開發者ID:Professorsaurus,項目名稱:Assignment-3-Final-Demo,代碼行數:20,代碼來源:categories.php

示例3: load

 public function load($iTopicID)
 {
     $oCon = new Connection();
     $sSQL = 'SELECT TopicID,TopicSubject,TopicDesc,TopicDate,CategoryID,MemberID,Active FROM tbtopics WHERE TopicID=' . $iTopicID;
     $oResultSet = $oCon->query($sSQL);
     $aRow = $oCon->fetchArray($oResultSet);
     $this->iTopicID = $aRow['TopicID'];
     $this->sTopicSubject = $aRow['TopicSubject'];
     $this->sTopicDesc = $aRow['TopicDesc'];
     $this->sTopicDate = $aRow['TopicDate'];
     $this->iCategoryID = $aRow['CategoryID'];
     $this->iMemberID = $aRow['MemberID'];
     $this->iActive = $aRow['Active'];
     $sSQL = 'SELECT PostID FROM tbposts WHERE Active = 1 AND TopicID=' . $iTopicID;
     $oResultSet = $oCon->query($sSQL);
     while ($aRow = $oCon->fetchArray($oResultSet)) {
         $iPostID = $aRow['PostID'];
         $oPost = new Post();
         $oPost->load($iPostID);
         $this->aPosts[] = $oPost;
     }
     $oCon->close();
 }
開發者ID:Professorsaurus,項目名稱:Assignment-3-Final-Demo,代碼行數:23,代碼來源:topics.php

示例4: load

 public function load($iPostID)
 {
     $oCon = new Connection();
     $sSQL = 'SELECT PostID,PostContent,PostDate,TopicID,MemberID,Active FROM tbposts WHERE PostID = ' . $iPostID;
     $aResultSet = $oCon->query($sSQL);
     $aRow = $oCon->fetchArray($aResultSet);
     $this->iPostID = $aRow['PostID'];
     $this->sPostContent = $aRow['PostContent'];
     $this->sPostDate = $aRow['PostDate'];
     $this->iTopicID = $aRow['TopicID'];
     $this->iMemberID = $aRow['MemberID'];
     $this->iActive = $aRow['Active'];
     $oCon->close();
 }
開發者ID:Professorsaurus,項目名稱:Assignment-3-Final-Demo,代碼行數:14,代碼來源:posts.php

示例5: all

 public static function all()
 {
     $aCategories = [];
     $oCon = new Connection();
     $sSQL = 'SELECT CategoryID FROM tbcategory WHERE Active=1';
     $oResultSet = $oCon->query($sSQL);
     while ($aRow = $oCon->fetchArray($oResultSet)) {
         $iCategoryID = $aRow['CategoryID'];
         $oCategory = new Category();
         $oCategory->load($iCategoryID);
         $aCategories[] = $oCategory;
     }
     $oCon->close();
     return $aCategories;
 }
開發者ID:Professorsaurus,項目名稱:Assignment-3-Final-Demo,代碼行數:15,代碼來源:categoryManager.php

示例6: loadByEmail

 public function loadByEmail($sEmail)
 {
     $oCon = new Connection();
     $sSQL = "SELECT CustomerID  \n\t\t\t\tFROM tbcustomer \n\t\t\t\tWHERE Email = '" . $sEmail . "'";
     $oResultSet = $oCon->query($sSQL);
     $aRow = $oCon->fetchArray($oResultSet);
     if ($aRow == true) {
         $sID = $aRow['CustomerID'];
         $this->load($sID);
         return true;
     } else {
         return false;
     }
     $oCon->close();
 }
開發者ID:wasim01,項目名稱:theRecordBreakers,代碼行數:15,代碼來源:customer.php

示例7: loadByEmail

 public function loadByEmail($sMemberEmail)
 {
     $oCon = new Connection();
     $sSQL = "SELECT MemberID FROM tbmember WHERE MemberEmail='" . $oCon->escape($sMemberEmail) . "'";
     $oResultSet = $oCon->query($sSQL);
     $aRow = $oCon->fetchArray($oResultSet);
     if ($aRow == true) {
         $sID = $aRow["MemberID"];
         $this->load($sID);
         return true;
     } else {
         return false;
     }
     $oCon->close();
 }
開發者ID:Professorsaurus,項目名稱:Assignment-3-Final-Demo,代碼行數:15,代碼來源:member.php

示例8: all

 public static function all()
 {
     $aGenres = array();
     $oCon = new Connection();
     $sSQL = "SELECT GenreID FROM tbgenres";
     $oResultSet = $oCon->query($sSQL);
     while ($aRow = $oCon->fetchArray($oResultSet)) {
         $iGenreID = $aRow["GenreID"];
         $oGenre = new Genre();
         $oGenre->load($iGenreID);
         $aGenres[] = $oGenre;
     }
     $oCon->close();
     return $aGenres;
 }
開發者ID:wasim01,項目名稱:theRecordBreakers,代碼行數:15,代碼來源:genremanager.php


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