flagflag  
Page Top

API anchor.png

 
Page Top
$DB->count_records anchor.png
$count = $DB->count_records('autoattend_sessions', array('courseid'=>$course->id, 'sessdate'=>$sdate, 'starttime'=>$starttime));
 
Page Top
$DB->insert_record anchor.png
  • record_id insert_record($table, $dataobject, $returnid=true, $bulk=false);
    $apply_id = $DB->insert_record('apply', $apply);
Page Top
$DB->update_record anchor.png
  • bool update_record($table, $dataobject, $bulk=false);
    update_record('apply', $apply);
Page Top
$DB->delete_records anchor.png
  • bool delete_records($table, array $conditions=null)
    $ret = $DB->delete_records('event', array('modulename'=>'apply', 'instance'=>$apply_id));
Page Top
$DB->get_record anchor.png
  • object get_record($table, array $conditions, $fields='*', $strictness=IGNORE_MISSING)
    $item = $DB->get_record('apply_item', array('id'=>$apply_id));
    $name = $item->name;
Page Top
$DB->get_records anchor.png
  • 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;
        ......
Page Top
$DB->get_records_select anchor.png
  • array(object) get_records_select($table, $select, array $params=null, $sort='', $fields='*', $limitfrom=0, $limitnum=0)
  • $select の ? に 配列 $params の要素が対応(並び順)
  • $select 中の :変数名 に $params の各要素が対応
  • name が結果の配列のキーになる(重複があるとワーニング)
    $templates = $DB->get_records_select('apply_template', 'course=? OR ispublic=1', array($course->id), 'name');
Page Top
$DB->get_records_sql anchor.png
  • array(object) get_records_sql($sql, array $params=null, $limitfrom=0, $limitnum=0)
  • $sql の ? に 配列 $params の要素が対応(並び順)
  • $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);
     
Page Top
$DB->execute anchor.png
  • array(object) execute($sql, array $params=null)
  • $sql の ? に 配列 $params の要素が対応(並び順)
  • $sql 中の :変数名 に $params の各要素が対応
     

Front page   Freeze Diff Backup Copy Rename Reload   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)
Counter: 554, today: 2, yesterday: 0
Last-modified: 2021-07-29 (Thu) 14:37:32 (JST) (1437d) by iseki

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthJul 2025Next Month
Su Mo Tu We Th Fr Sa
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
Today

Who's Online

104 user(s) are online (12 user(s) are browsing xpwiki)

Members: 0
Guests: 104

more...

Access Counter

Today : 5144514451445144
Yesterday : 9851985198519851
Total : 2741749427417494274174942741749427417494274174942741749427417494
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com