本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}