flagflag  If you want to see English page, please click "English" Button at Left.
3: 2013-03-16 (土) 13:33:22 iseki ソース 4: 2013-03-20 (水) 10:20:04 iseki ソース
Line 1: Line 1:
* 2.4 [#oca60059] * 2.4 [#oca60059]
 +
 +** DB [#z14aa49f]
 +- lib/dml/moodle_database.php
 +#br
 +
 +*** 大域変数 $DB [#df2c344a]
 +**** $DB->insert_record [#ua6949a2]
 +- record_id insert_record($table, $dataobject, $returnid=true, $bulk=false);
 + $apply_id = $DB->insert_record('apply', $apply);
 +
 +**** $DB->update_record [#h3d4dcda]
 +- bool update_record($table, $dataobject, $bulk=false);
 + update_record('apply', $apply);
 +
 +**** $DB->delete_records [#kbebef5f]
 +- bool delete_records($table, array $conditions=null)
 + $ret = $DB->delete_records('event', array('modulename'=>'apply', 'instance'=>$apply_id));
 +
 +**** $DB->get_record [#ddb2fca9]
 +- object get_record($table, array $conditions, $fields='*', $strictness=IGNORE_MISSING)
 + $item = $DB->get_record('apply_item', array('id'=>$apply_id));
 + $name = $item->name;
 +
 +**** $DB->get_records [#d0deebeb]
 +- array(object) get_records($table, array $conditions=null, $sort='', $fields='*', $limitfrom=0, $limitnum=0)
 + $params = array('apply_id'=>$item->apply_id);
 + $items = $DB->get_records('apply_item', $params, 'position');
 + foreach ($items as $item) {
 +     $name = $item->name;
 +     ......
 +
 +**** $DB->get_records_select [#w11aa7e9]
 +- array(object) get_records_select($table, $select, array $params=null, $sort='', $fields='*', $limitfrom=0, $limitnum=0)
 +- $select の ''?'' に 配列 $params の要素が対応(並び順)
 + $templates = $DB->get_records_select('apply_template'​, 'course=? OR ispublic=1', array($course->id), 'name');
 +
 +**** $DB->get_records_sql [#kb220662]
 +- array(object) get_records_sql($sql, array $params=null, $limitfrom=0, $limitnum=0)
 +- $sql 中の '':変数名'' に $params の各要素が対応
 + $where = 'WHERE as.id=av.submit_id AND av.version=0 AND as.apply_id=:apply_id AND ai.id=av.item_id ';
 + $sql  = 'SELECT MAX(ai.position) FROM {apply_submit} as, {apply_value} av, {apply_item} ai '.$where;
 + $params = array();
 + $params['apply_id'] = $apply_id;
 + $lastpos = $DB->get_field_sql($sql, $params);
** Block [#p1b83bad] ** Block [#p1b83bad]


トップ   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 5月翌月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
<今日>

オンライン状況

113 人のユーザが現在オンラインです。 (21 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 113

もっと...

アクセスカウンタ

今日 : 396396396
昨日 : 1753317533175331753317533
総計 : 2346353923463539234635392346353923463539234635392346353923463539
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com