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


PHP DBC::getRecordByID方法代碼示例

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


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

示例1: DBC

 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 * 
 * Alternatively, the contents of this file may be used under the terms of
 * the GNU General Public License version 3 license (the "GPLv3"), in which
 * case the provisions of the GPLv3 are applicable instead of the above.
 * 
 * @author	Tim Kurvers <tim@moonsphere.net>
 */
error_reporting(E_ALL | E_STRICT);
require '../lib/bootstrap.php';
/**
 * This example shows basic usage of the World of Warcraft DBC Library API
 */
// Open the given DBC (ensure read-access)
$dbc = new DBC('./dbcs/Spell.dbc');
// Fetch the first record (zero-based); Will return null if no record was found
$record = $dbc->getRecordById(13494);
var_dump($record);
exit;
// Fetch a record by its first field (generally containing the id); Will return null if no record was found
$record = $dbc->getRecordByID(0);
// Check for the 11th record's existence
$exists = $dbc->hasRecord(1);
// Loop over all records in this DBC and query each one
foreach ($dbc as $r) {
    var_dump('Record #' . $r->getID() . ' with name: ' . $r->getString(1));
    $r->dump(true);
}
開發者ID:xianyinchen,項目名稱:EventAI-to-SmartAI,代碼行數:31,代碼來源:api.php

示例2: DBC

 * The contents of this file are subject to the MIT License, under which
 * this library is licensed. See the LICENSE file for the full license.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * @author	Tim Kurvers <tim@moonsphere.net>
 */
error_reporting(E_ALL | E_STRICT);
require '../lib/bootstrap.php';
/**
 * This example shows basic usage of the World of Warcraft DBC Library API
 */
// Open the given DBC (ensure read-access)
$dbc = new DBC('./dbcs/Sample.dbc');
// Fetch the first record (zero-based); Will return null if no record was found
$record = $dbc->getRecord(0);
// Fetch a record by its first field (generally containing the id); Will return null if no record was found
$record = $dbc->getRecordByID(3);
// Check for the 11th record's existence
$exists = $dbc->hasRecord(1);
// Loop over all records in this DBC and query each one
foreach ($dbc as $r) {
    var_dump('Record #' . $r->getID() . ' with name: ' . $r->getString(1));
    $r->dump(true);
}
開發者ID:WyriMaps,項目名稱:php-wow-dbc,代碼行數:31,代碼來源:api.php


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