当前位置: 首页>>代码示例>>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;未经允许,请勿转载。