ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 3402


Ignore:
Timestamp:
Jul 10, 2007, 6:11:42 PM (12 years ago)
Author:
ToshihiroK
Message:

postgres対応

Location:
OpenPNE/branches/prj/postgres/2_8_1
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/OpenPNE/DB.php

    r1856 r3402  
    4747
    4848        $this->db->setFetchMode(DB_FETCHMODE_ASSOC);
    49         $this->db->query('SET NAMES utf8');
     49//        $this->db->query('SET NAMES utf8');
    5050    }
    5151
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/commu.php

    r3372 r3402  
    515515    $is_recurred = false;
    516516
    517     $sql = "SELECT cct.c_commu_topic_id , cct.name, MAX(cctc.r_datetime) as r_datetime , cct.c_commu_id " .
    518             " , cctc.image_filename1, cctc.image_filename2, cctc.image_filename3 " .
    519             " FROM c_commu_topic_comment as cctc , c_commu_topic as cct" .
    520             " WHERE cctc.c_commu_topic_id = cct.c_commu_topic_id " .
    521             " AND cct.event_flag = ?".
    522             " AND cct.c_commu_id = ?".
    523             " group by cct.c_commu_topic_id " .
    524                 ", cct.name" .
    525                 ", cct.c_commu_id" .
    526                 ", cctc.image_filename1" .
    527                 ", cctc.image_filename2" .
    528                 ", cctc.image_filename3" .
     517    $sql =  " SELECT cct.c_commu_topic_id , cct.name, sub_tbl.r_datetime , cct.c_commu_id " .
     518                    " , cctc.image_filename1, cctc.image_filename2, cctc.image_filename3 " .
     519            " FROM (" .
     520                    "SELECT cct.c_commu_topic_id ,MAX(cctc.r_datetime) as r_datetime" .
     521                    " from" .
     522                        " c_commu_topic_comment as cctc , c_commu_topic as cct".
     523                    " WHERE cctc.c_commu_topic_id = cct.c_commu_topic_id " .
     524                        " AND cct.event_flag = ?".
     525                        " AND cct.c_commu_id = ?".
     526                    " GROUP BY cct.c_commu_topic_id " .
     527                    ") as sub_tbl, c_commu_topic_comment as cctc , c_commu_topic as cct" .
     528            " WHERE cct.c_commu_topic_id=sub_tbl.c_commu_topic_id and cctc.c_commu_topic_id = cct.c_commu_topic_id " .
     529                " AND cctc.r_datetime=sub_tbl.r_datetime".
    529530            " order by r_datetime desc ";
    530    
     531
    531532    $params = array($event_flag, intval($c_commu_id));
    532533    $list = db_get_all_limit($sql, 0, $limit, $params);
     
    811812
    812813    $hint = db_mysql_hint('USE INDEX (r_datetime_c_commu_id)');
    813     $sql = 'SELECT cct.c_commu_topic_id, cct.c_commu_id, MAX(cctc.r_datetime) as r_datetime, cct.c_member_id'.
    814         ' FROM c_commu_topic as cct, c_commu_topic_comment as cctc'. $hint . ' WHERE cct.c_commu_id IN (' . $ids . ') AND cctc.c_commu_topic_id = cct.c_commu_topic_id'.
    815         ' GROUP BY cctc.c_commu_topic_id'.
     814   
     815    $sql = 'SELECT sub_cct_tbl.c_commu_topic_id, cct.c_commu_id, sub_cct_tbl.r_datetime, cct.c_member_id'.
     816        ' FROM (' .
     817                ' SELECT cct.c_commu_topic_id, MAX(cctc.r_datetime) as r_datetime' .
     818                ' FROM' .
     819                    ' c_commu_topic as cct, c_commu_topic_comment as cctc'. $hint .
     820                ' WHERE ' .
     821                    ' cct.c_commu_id IN (' . $ids . ') AND cctc.c_commu_topic_id = cct.c_commu_topic_id'.
     822                ' GROUP BY cct.c_commu_topic_id' .
     823                ') as sub_cct_tbl, c_commu_topic_comment as cctc , c_commu_topic as cct' .
     824        ' WHERE' .
     825            ' cct.c_commu_topic_id=sub_cct_tbl.c_commu_topic_id' .
     826            ' AND cctc.c_commu_topic_id = cct.c_commu_topic_id ' .
     827            ' AND cctc.r_datetime=sub_cct_tbl.r_datetime' .
    816828        ' ORDER BY r_datetime DESC';
     829
    817830    $c_commu_topic_list = db_get_all_limit($sql, 0, $limit);
    818831
     
    857870
    858871    $hint = db_mysql_hint('USE INDEX (r_datetime_c_commu_id)');
    859     $sql = 'SELECT cct.c_commu_topic_id, cct.c_commu_id, MAX(cctc.r_datetime) as r_datetime, cct.c_member_id'.
    860         ' FROM c_commu_topic as cct, c_commu_topic_comment as cctc'. $hint . ' WHERE cct.c_commu_id IN (' . $ids . ') AND cctc.c_commu_topic_id = cct.c_commu_topic_id'.
    861         ' GROUP BY cctc.c_commu_topic_id'.
     872    $sql = 'SELECT sub_cct_tbl.c_commu_topic_id, cct.c_commu_id, sub_cct_tbl.r_datetime, cct.c_member_id'.
     873        ' FROM (' .
     874                ' SELECT cct.c_commu_topic_id, MAX(cctc.r_datetime) as r_datetime' .
     875                ' FROM' .
     876                    ' c_commu_topic as cct, c_commu_topic_comment as cctc'. $hint .
     877                ' WHERE ' .
     878                    ' cct.c_commu_id IN (' . $ids . ') AND cctc.c_commu_topic_id = cct.c_commu_topic_id'.
     879                ' GROUP BY cct.c_commu_topic_id' .
     880                ') as sub_cct_tbl, c_commu_topic_comment as cctc , c_commu_topic as cct' .
     881        ' WHERE' .
     882            ' cct.c_commu_topic_id=sub_cct_tbl.c_commu_topic_id' .
     883            ' AND cctc.c_commu_topic_id = cct.c_commu_topic_id ' .
     884            ' AND cctc.r_datetime=sub_cct_tbl.r_datetime' .
    862885        ' ORDER BY r_datetime DESC';
    863886    $c_commu_topic_list = db_get_all_limit($sql, ($page-1)*$limit, $limit);
     
    927950
    928951    $sql .= " AND cct.c_commu_id = ?" .
    929             " GROUP BY c_commu_topic_id " .
     952            " GROUP BY cct.c_commu_topic_id " .
    930953            " ORDER BY newest_write_datetime DESC";
    931954    $params = array(intval($c_commu_id));
     
    11791202    $is_recurred = false;
    11801203
    1181     $sql = 'SELECT DISTINCT c.* FROM c_commu_member AS cm, c_commu AS c' .
     1204    $sql = 'SELECT DISTINCT c.*, RANDOM() FROM c_commu_member AS cm, c_commu AS c' .
    11821205            ' WHERE cm.c_member_id = ? AND c.c_commu_id = cm.c_commu_id' .
    11831206            ' ORDER BY RANDOM()';
     
    16931716    case 'count':
    16941717        $from  = ' FROM c_commu, c_commu_member';
     1718        $sub_tbl = ' (' .
     1719                        'SELECT c_commu_member.c_commu_id, count(c_commu_member.c_commu_member_id) as count_commu_member' .
     1720                        $from .
     1721                        $where . ' AND c_commu_member.c_commu_id = c_commu.c_commu_id' .
     1722                        ' GROUP BY c_commu_member.c_commu_id' .
     1723                    ') as sub_commu_tbl';
    16951724        $order = ' ORDER BY count_commu_member DESC';
    1696         $group = ' GROUP BY c_commu_member.c_commu_id';
    1697         $sql = $select . ', COUNT(c_commu_member.c_member_id) AS count_commu_member' .
    1698             $from .
    1699             $where . ' AND c_commu_member.c_commu_id = c_commu.c_commu_id' .
    1700             $group .
    1701             $order;
     1725        $sql = $select .
     1726                ' FROM' . $sub_tbl . ', c_commu' .
     1727                ' WHERE c_commu.c_commu_id = sub_commu_tbl.c_commu_id' .
     1728                $order;
    17021729        break;
    17031730    }
     
    18021829function db_commu_c_topic4c_commu_topic_id_2($c_commu_topic_id)
    18031830{
    1804     $sql = "SELECT cct.*, cctc.*, cm.nickname, cpp.pref" .
     1831    $sql = "SELECT cct.*, cctc.*, cm.nickname, cpp.pref, case when cct.invite_period = '0001-01-01 BC' THEN '0000-00-00' ELSE to_char(cct.invite_period,'YYYY-MM-DD') END as invite_period" .
    18051832        " FROM c_commu_topic as cct" .
    18061833        " LEFT JOIN c_commu_topic_comment as cctc ON cct.c_commu_topic_id = cctc.c_commu_topic_id" .
     
    21512178function db_commu_update_is_regist_join($c_commu_id, $value = 0)
    21522179{
    2153     $data = array('is_regist_join' => (bool)$value);
     2180    $data = array('is_regist_join' => (int)$value);
    21542181    $where = array('c_commu_id' => intval($c_commu_id));
    21552182    return db_update('c_commu', $data, $where);
     
    24022429    $data = array(
    24032430        'name'       => $topic['name'],
    2404         'event_flag' => (bool)$topic['event_flag'],
     2431        'event_flag' => (int)$topic['event_flag'],
    24052432        'capacity' => intval($topic['capacity']),
    24062433        'r_datetime' => db_now(),
    24072434        'r_date' => db_now(),
    24082435    );
     2436    $open_date = '0000-01-01';
     2437    $invite_period = '0000-01-01';
     2438    if (isset($topic['open_date']) && $topic['open_date'] != '') {
     2439        $open_date = $topic['open_date'];
     2440    }
     2441   
     2442    if (isset($topic['invite_period']) && $topic['invite_period'] != '') {
     2443        $invite_period = $topic['invite_period'];
     2444    }
     2445   
    24092446    if ($data['event_flag']) {
    24102447        $data += array(
    2411             'open_date'         => $topic['open_date'],
     2448            'open_date'         => $open_date,
    24122449            'open_date_comment' => $topic['open_date_comment'],
    24132450            'open_pref_id'      => intval($topic['open_pref_id']),
    24142451            'open_pref_comment' => $topic['open_pref_comment'],
    2415             'invite_period'     => $topic['invite_period'],
     2452            'invite_period'     => $invite_period,
    24162453        );
    24172454    }
     
    24802517        'r_date'      => db_now(),
    24812518    );
     2519
     2520    $open_date = '0000-01-01';
     2521    $invite_period = '0000-01-01';
     2522    if (isset($topic['open_date']) && $topic['open_date'] != '') {
     2523        $open_date = $topic['open_date'];
     2524    }
     2525    if (isset($topic['invite_period']) && $topic['invite_period'] != '') {
     2526        $invite_period = $topic['invite_period'];
     2527    }
     2528
    24822529    if ($data['event_flag']) {
    24832530        $data += array(
    2484             'open_date'         => $topic['open_date'],
     2531            'open_date'         => $open_date,
    24852532            'open_date_comment' => $topic['open_date_comment'],
    24862533            'open_pref_id'      => intval($topic['open_pref_id']),
    24872534            'open_pref_comment' => $topic['open_pref_comment'],
    2488             'invite_period'     => $topic['invite_period'],
     2535            'invite_period'     => $invite_period,
    24892536        );
    24902537    }
     
    25642611    $sql = 'SELECT c_commu_topic_id FROM c_commu_topic'
    25652612         . ' WHERE c_commu_topic_id = ?'
    2566          . ' AND (open_date >= ? OR open_date = \'0000-00-00\')'
    2567          . ' AND (invite_period >= ? OR invite_period = \'0000-00-00\')';
     2613         . ' AND (open_date >= ? OR open_date = \'0000-01-01\')'
     2614         . ' AND (invite_period >= ? OR invite_period = \'0000-01-01\')';
    25682615    $now = date('Y-m-d');
    25692616    $params = array(intval($c_commu_topic_id), $now, $now);
     
    26332680{
    26342681    $data = array(
    2635         'is_receive_mail' => (bool)$is_receive_mail,
    2636         'is_receive_mail_pc' => (bool)$is_receive_mail_pc,
    2637         'is_receive_message' => (bool)$is_receive_message,
     2682        'is_receive_mail' => (int)$is_receive_mail,
     2683        'is_receive_mail_pc' => (int)$is_receive_mail_pc,
     2684        'is_receive_message' => (int)$is_receive_message,
    26382685
    26392686    );
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/diary.php

    r3057 r3402  
    528528            ' AND c_diary.c_member_id NOT IN (' . $except_ids . ')' .
    529529            ' AND c_diary.public_flag <> \'private\'';
     530
    530531    $params = array(intval($c_member_id), $date);
    531532    $c_diary_id_list = db_get_col($sql, $params);
    532533    $c_diary_id_list = array_unique($c_diary_id_list);
     534
    533535    if (!$c_diary_id_list) {
    534536        return array();
     
    566568    $firends[] = 0;
    567569    $friend_ids = implode(',', $friends);
    568 
     570   
    569571    $sql = 'SELECT d.c_diary_id' .
    570572            ', d.subject' .
    571573            ', d.c_member_id' .
    572             ', MAX(dc.r_datetime) AS r_datetime' .
    573             ', COUNT(DISTINCT dc.c_diary_comment_id) AS num_comment' .
     574            ', sub_diary_tbl.r_datetime' .
     575            ', sub_diary_tbl.num_comment' .
    574576        ' FROM c_diary AS d' .
    575             ' INNER JOIN c_diary_comment AS dc USING (c_diary_id)' .
    576             ', c_diary_comment AS mydc' .
    577         ' WHERE mydc.c_member_id = ?' .
    578             ' AND mydc.c_diary_id = d.c_diary_id' .
    579             ' AND mydc.c_member_id <> d.c_member_id' .
    580             ' AND d.c_member_id NOT IN (' . $except_ids . ')' .
    581             ' AND (d.public_flag = \'public\' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . ')))' .
    582         ' GROUP BY dc.c_diary_id' .
     577            ', ( SELECT dc.c_diary_id' .
     578                    ', MAX(dc.r_datetime) AS r_datetime' .
     579                    ', COUNT(DISTINCT dc.c_diary_comment_id) AS num_comment' .
     580                ' FROM c_diary AS d' .
     581                    ' INNER JOIN c_diary_comment AS dc USING (c_diary_id)' .
     582                    ', c_diary_comment AS mydc' .
     583                ' WHERE mydc.c_member_id = ?' .
     584                    ' AND mydc.c_diary_id = d.c_diary_id' .
     585                    ' AND mydc.c_member_id <> d.c_member_id' .
     586                    ' AND d.c_member_id NOT IN (' . $except_ids . ')' .
     587                    ' AND (d.public_flag = \'public\' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . ')))' .
     588                ' GROUP BY dc.c_diary_id' .
     589            ') as sub_diary_tbl' .
     590        ' WHERE' .
     591            ' sub_diary_tbl.c_diary_id = d.c_diary_id' .
    583592        ' ORDER BY r_datetime DESC';
    584593
     
    789798
    790799    $pf_cond = db_diary_public_flag_condition($c_member_id, $u);
    791     $sql = 'SELECT DISTINCT DAYOFMONTH(r_datetime) FROM c_diary' .
    792            ' WHERE c_member_id = ? AND r_datetime >= ? AND r_datetime < ?' . $pf_cond;
     800    $sql = "SELECT DISTINCT date_part('day', r_datetime) FROM c_diary" .
     801           " WHERE c_member_id = ? AND r_datetime >= ? AND r_datetime < ?" . $pf_cond;
    793802
    794803    $date_format = '%Y-%m-%d 00:00:00';
     
    10861095{
    10871096    $data = array(
    1088         'is_checked' => (bool)$value,
     1097        'is_checked' => (int)$value,
    10891098    );
    10901099    $where = 'c_diary_id = '.intval($c_diary_id);
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/etc.php

    r3067 r3402  
    613613        'target_c_commu_topic_id' => 0,
    614614        'target_c_diary_id'       => 0,
    615         'ktai_flag'               => (bool)$ktai_flag,
     615        'ktai_flag'               => (int)$ktai_flag,
    616616        'r_datetime' => db_now(),
    617617    );
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/file.php

    r2659 r3402  
    5959    $data = array(
    6060        'filename'   => $filename,
    61         'bin'        => $bin,
     61        'bin'        => base64_encode($bin),
    6262        'original_filename' => $original_filename,
    6363        'r_datetime' => db_now(),
     
    7676    $sql = 'SELECT * FROM c_file WHERE filename = ?';
    7777    $params = array($filename);
    78     return db_get_row($sql, $params);
     78    $lst = db_get_row($sql, $params);
     79    $lst['bin'] = base64_decode($lst['bin']);
     80    return $lst;
    7981}
    8082
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/member.php

    r3372 r3402  
    2626    $is_recurred = false;
    2727
    28     $sql = 'SELECT * FROM c_member WHERE c_member_id = ?';
     28    $sql = "SELECT *,case when access_date = '0001-01-01 00:00:00 BC' THEN '0000-00-00 00:00:00' ELSE to_char(access_date,'YYYY-MM-DD HH24:MI:SS') END as access_date" .
     29         " FROM c_member WHERE c_member_id = ?";
    2930    $params = array(intval($c_member_id));
    3031    if (!$c_member = db_get_row($sql, $params))
     
    10671068   
    10681069    $data = array(
    1069         'is_receive_mail' => (bool)$is_receive_mail,
     1070        'is_receive_mail' => (int)$is_receive_mail,
    10701071        'is_receive_daily_news' => intval($is_receive_daily_news),
    10711072        'rss' => $rss,
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/message.php

    r3057 r3402  
    573573        'body'       => $body,
    574574        'r_datetime' => db_now(),
    575         'is_send'    => (bool)$is_send,
     575        'is_send'    => (int)$is_send,
    576576    );
    577577    $where = array('c_message_id' => intval($c_message_id));
     
    790790function db_message_c_message_sender_list4c_member_id($c_member_id)
    791791{
    792     $sql = "SELECT distinct c_member_id_from FROM c_message";
     792
    793793    $where = "c_member_id_to = ?".
    794794            " AND is_deleted_to = 0" .
    795795            " AND is_send = 1";
    796     $sql .= " WHERE $where";
     796
     797    $sql = "SELECT c_member_id_from" .
     798            " FROM" .
     799                "(" .
     800                    "SELECT distinct on(c_member_id_from) *" .
     801                    " FROM" .
     802                        " c_message" .
     803                    " WHERE " . $where .
     804                ") as sub_member_tbl";
     805   
    797806    $sql .= " ORDER BY r_datetime DESC";
    798807    $params = array(intval($c_member_id));
     
    811820function db_message_c_message_receiver_list4c_member_id($c_member_id)
    812821{
    813     $sql = "SELECT distinct c_member_id_to FROM c_message";
    814822    $where = "c_member_id_from = ?".
    815823            " AND is_deleted_from = 0" .
    816824            " AND is_send = 1";
    817     $sql .= " WHERE $where";
     825    $sql = "SELECT c_member_id_to" .
     826            " FROM" .
     827                "(" .
     828                    "SELECT distinct on(c_member_id_to) *" .
     829                    " FROM" .
     830                        " c_message" .
     831                    " WHERE " . $where .
     832                ") as sub_member_tbl";
     833
    818834    $sql .= " ORDER BY r_datetime DESC";
    819835    $params = array(intval($c_member_id));
     
    903919    }
    904920
    905     $sql = 'SELECT DISTINCT DAYOFMONTH(r_datetime) FROM c_message' .
     921    $sql = "SELECT DISTINCT date_part('day', r_datetime) FROM c_message" .
    906922           " WHERE $where" .
    907923           ' AND is_send=1 AND r_datetime >= ? AND r_datetime < ?';
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/review.php

    r3372 r3402  
    176176    case "r_datetime":
    177177    default:
    178         $order = " ORDER BY r_datetime DESC";
     178        $order = " ORDER BY r_datetime2 DESC";
    179179        break;
    180180    case "r_num":
    181         $order = " ORDER BY write_num DESC, r_datetime DESC";
     181        $order = " ORDER BY write_num DESC, r_datetime2 DESC";
    182182        break;
    183183    }
     
    185185    $sql = "SELECT" .
    186186            " c_review.*" .
    187             ", MAX(c_review_comment.r_datetime) as r_datetime" .
     187            ", MAX(c_review_comment.r_datetime) as r_datetime2" .
    188188            ", COUNT(c_review_comment.c_review_comment_id) AS write_num" .
    189189        $from .
    190190        $where .
    191191        " GROUP BY c_review.c_review_id" .
     192            ", c_review.title" .
     193            ", c_review.release_date" .
     194            ", c_review.manufacturer" .
     195            ", c_review.author" .
     196            ", c_review.c_review_category_id" .
     197            ", c_review.image_small" .
     198            ", c_review.image_medium" .
     199            ", c_review.image_large" .
     200            ", c_review.url" .
     201            ", c_review.asin" .
     202            ", c_review.list_price" .
     203            ", c_review.retail_price" .
     204            ", c_review.r_datetime" .
    192205        $order;
    193206
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/lib/db/schedule.php

    r1856 r3402  
    5353    $sql = 'SELECT * FROM c_commu_topic WHERE c_commu_id IN ('.$ids.')' .
    5454            ' AND event_flag = 1 AND open_date > ? AND open_date <= ?';
     55    $max_day = date("t", mktime(0,0,0,intval($month),1,intval($year) ));
    5556    $params = array(
    56         sprintf('%04d-%02d', intval($year), intval($month)) . '-00',
    57         sprintf('%04d-%02d', intval($year), intval($month)) . '-31'
     57//        sprintf('%04d-%02d', intval($year), intval($month)) . '-00',
     58        sprintf('%04d-%02d', intval($year), intval($month)) . '-01',
     59        sprintf('%04d-%02d', intval($year), intval($month)) . '-' . $max_day
    5860    );
    5961    $list = db_get_all($sql, $params);
     
    9799        'end_date' => $end_date,
    98100        'end_time' => $end_time,
    99         'is_receive_mail' => (bool)$is_receive_mail,
     101        'is_receive_mail' => $is_receive_mail,
    100102    );
    101103    return db_insert('c_schedule', $data);
     
    117119        'end_date' => $end_date,
    118120        'end_time' => $end_time,
    119         'is_receive_mail' => (bool)$is_receive_mail,
     121        'is_receive_mail' => $is_receive_mail,
    120122    );
    121123    $where = array('c_schedule_id' => intval($c_schedule_id));
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/modules/admin/do/csv_member.php

    r3296 r3402  
    4242        $params = array();
    4343        $sql = 'SELECT c_member_id FROM c_member ';
    44         $sql .= ' WHERE 1 ' ;
     44        $sql .= ' WHERE true ' ;
    4545        if ($start_id > 1) {
    4646            $sql .= ' AND c_member_id >= ? ';
  • OpenPNE/branches/prj/postgres/2_8_1/webapp/modules/admin/lib/db_admin.php

    r3281 r3402  
    177177    pne_cache_drop('db_member_c_profile_list');
    178178
     179    if (empty($info) || is_null($info)) {
     180        $info = '';
     181    }
     182
    179183    $data = array(
    180184        'name' => $name,
    181185        'caption' => $caption,
    182186        'info' => $info,
    183         'is_required' => (bool)$is_required,
    184         'public_flag_edit' => (bool)$public_flag_edit,
     187        'is_required' => (int)$is_required,
     188        'public_flag_edit' => (int)$public_flag_edit,
    185189        'public_flag_default' => $public_flag_default,
    186190        'form_type' => $form_type,
    187191        'sort_order' => (int)$sort_order,
    188         'disp_regist' => (bool)$disp_regist,
    189         'disp_config' => (bool)$disp_config,
    190         'disp_search' => (bool)$disp_search,
     192        'disp_regist' => (int)$disp_regist,
     193        'disp_config' => (int)$disp_config,
     194        'disp_search' => (int)$disp_search,
    191195        'val_type' => $val_type,
    192196        'val_regexp' => $val_regexp,
     
    214218    , $val_max
    215219    )
    216 {
     220{
     221    if (empty($info) || is_null($info)) {
     222        $info = '';
     223    }
     224   
    217225    $data = array(
    218226        'name' => $name,
    219227        'caption' => $caption,
    220228        'info' => $info,
    221         'is_required' => (bool)$is_required,
    222         'public_flag_edit' => (bool)$public_flag_edit,
     229        'is_required' => (int)$is_required,
     230        'public_flag_edit' => (int)$public_flag_edit,
    223231        'public_flag_default' => $public_flag_default,
    224232        'form_type' => $form_type,
    225233        'sort_order' => intval($sort_order),
    226         'disp_regist' => (bool)$disp_regist,
    227         'disp_config' => (bool)$disp_config,
    228         'disp_search' => (bool)$disp_search,
     234        'disp_regist' => (int)$disp_regist,
     235        'disp_config' => (int)$disp_config,
     236        'disp_search' => (int)$disp_search,
    229237        'val_type' => $val_type,
    230238        'val_regexp' => $val_regexp,
     
    234242    $where = array('c_profile_id' => intval($c_profile_id));
    235243    db_update('c_profile', $data, $where);
    236 
     244   
    237245    // 公開設定が固定のときはメンバーの設定値を上書き
    238246    if (!$public_flag_edit) {
     
    546554    $sql = 'SELECT c_member_id'.
    547555           ' FROM c_member'.
    548            ' WHERE 1';
     556           ' WHERE true';
    549557
    550558    //開始年
     
    685693    if (!empty($cond_list['is_pc_address']) || !empty($cond_list['is_ktai_address'])) {
    686694
    687         $sql = 'SELECT c_member_id FROM c_member_secure WHERE 1';
     695        $sql = 'SELECT c_member_id FROM c_member_secure WHERE true';
    688696
    689697        //PCアドレスの有無で絞る
     
    759767{
    760768    $ids = _db_admin_c_member_id_list($cond_list, $order);
     769
    761770    $total_num = count($ids);
    762771    $ids = array_slice($ids, ($page - 1) * $page_size, $page_size);
     
    933942function p_access_analysis_month_access_analysis_month($ktai_flag)
    934943{
    935     $sql = "SELECT concat(left(r_datetime, 7), '-01') as ym, count(*) as count" .
     944    $sql = "SELECT substr(r_datetime, 1, 7) || '-01' as ym, count(*) as count" .
    936945            " FROM c_access_log " .
    937946            " where ktai_flag = ?" .
    938947            " group by ym";
     948   
    939949    $params = array(intval($ktai_flag));           
    940950    $list = db_get_all($sql,$params);
     
    945955function p_access_analysis_day_access_analysis_day($ym, $ktai_flag)
    946956{
    947     $sql = "SELECT left(r_datetime,10) as ymd , count(*) as count" .
    948             " FROM c_access_log " .
    949             " where left(r_datetime, 7) = ?" .
    950             " and ktai_flag = ? " .
    951             " group by ymd";           
    952     $params = array(intval(substr($ym,0,7)),intval($ktai_flag));
     957    $sql = "SELECT substr(r_datetime,1,10) as ymd , count(*) as count" .
     958        " FROM c_access_log " .
     959        " where substr(r_datetime,1,7) = ?" .
     960        " and ktai_flag = ? " .
     961        " group by ymd";           
     962
     963    $params = array(substr($ym,0,7),intval($ktai_flag));
    953964    $list = db_get_all($sql,$params);
    954965   
     
    10011012    $params = array(intval($ktai_flag));
    10021013    if ($month_flag) {
    1003         $sql .= " and left(r_datetime, 7) = ? ";
     1014        $sql .= " and substr(r_datetime,1,7) = ? ";
    10041015        array_push($params,substr($ymd,0,7));
    10051016    } else {
    1006         $sql .= " and left(r_datetime,10) = ? ";
     1017        $sql .= " and substr(r_datetime,1,10) = ? ";
    10071018        array_push($params,$ymd);
    10081019    }
     
    10961107    $params = array(intval($ktai_flag));
    10971108    if ($month_flag) {
    1098             $sql .= " and left(r_datetime, 7) = ? ";
    1099             array_push($params,substr($ymd,0,7));
     1109        $sql .= " and substr(r_datetime,1,7) = ? ";
     1110        array_push($params,substr($ymd,0,7));
    11001111    } else {
    1101             $sql .= " and left(r_datetime,10) = ? ";
    1102             array_push($params,$ymd);
     1112        $sql .= " and substr(r_datetime,1,10) = ? ";
     1113        array_push($params,$ymd);
    11031114    }
    11041115    if ($page_name!="all") {
     
    11071118    }
    11081119    $sql .= " and target_c_commu_id <> 0 ";
    1109     $sql .= " group by target_c_commu_id " .$orderby_str." limit $start, $page_size";
     1120    $sql .= " group by target_c_commu_id " .$orderby_str." offset $start limit $page_size";
    11101121    $list = db_get_all($sql,$params);
    11111122
     
    11241135    $params = array(intval($ktai_flag));
    11251136    if ($month_flag) {
    1126         $sql .= " and left(r_datetime, 7) = ? ";
     1137        $sql .= " and substr(r_datetime,1,7) = ? ";
    11271138        array_push($params,substr($ymd,0,7));
    11281139    } else {
    1129         $sql .= " and left(r_datetime,10) = ? ";
     1140        $sql .= " and substr(r_datetime,1,10) = ? ";
    11301141        array_push($params,$ymd);
    11311142    }
     
    11751186    $params = array(intval($ktai_flag));
    11761187    if ($month_flag) {
    1177             $where .= " and left(r_datetime, 7) = ? ";
    1178             array_push($params,substr($ymd,0,7));
     1188        $where .= " and substr(r_datetime,1, 7) = ? ";
     1189        array_push($params,substr($ymd,0,7));
    11791190    } else {
    1180             $where .= " and left(r_datetime,10) = ? ";
    1181             array_push($params,$ymd);
     1191        $where .= " and substr(r_datetime,1,10) = ? ";
     1192        array_push($params,$ymd);
    11821193    }
    11831194    if ($page_name!="all") {
     
    11861197    }
    11871198    $sql = "select target_c_commu_topic_id , count(*) as count from c_access_log ";
    1188     $sql .= $where." group by target_c_commu_topic_id " .$orderby_str." limit $start, $page_size";
     1199    $sql .= $where." group by target_c_commu_topic_id " .$orderby_str." offset $start limit $page_size";
    11891200    $list = db_get_all($sql,$params);
    11901201    $sql = "select count(*) from c_access_log ";
     
    12451256    $params = array(intval($ktai_flag));
    12461257    if ($month_flag) {
    1247         $sql .= " and left(r_datetime, 7) = ? ";
     1258        $sql .= " and substr(r_datetime,1,7) = ? ";
    12481259        array_push($params,substr($ymd,0,7));
    12491260    } else {
    1250         $sql .= " and left(r_datetime,10) = ? ";
     1261        $sql .= " and substr(r_datetime,1,10) = ? ";
    12511262        array_push($params,$ymd);
    12521263    }
     
    12561267    }
    12571268    $sql .= " and target_c_diary_id <> 0 ";
    1258     $sql .= " group by target_c_diary_id " . $orderby_str. " limit $start, $page_size";
     1269    $sql .= " group by target_c_diary_id " . $orderby_str. " offset $start limit $page_size";
    12591270    $list = db_get_all($sql,$params);
    12601271
     
    12751286    $params = array(intval($ktai_flag));
    12761287    if ($month_flag) {
    1277             $sql .= " and left(r_datetime, 7) = ? ";
    1278             array_push($params,substr($ymd,0,7));
     1288        $sql .= " and substr(r_datetime,1,7) = ? ";
     1289        array_push($params,substr($ymd,0,7));
    12791290    } else {
    1280             $sql .= " and left(r_datetime,10) = ? ";
    1281             array_push($params,$ymd);
     1291        $sql .= " and substr(r_datetime,1,10) = ? ";
     1292        array_push($params,$ymd);
    12821293    }
    12831294    $sql .= " and target_c_diary_id <> 0 ";
     
    13231334    $params = array(intval($ktai_flag));
    13241335    if ($month_flag) {
    1325         $where .= " and left(r_datetime, 7) = ? ";
     1336        $where .= " and substr(r_datetime,1,7) = ? ";
    13261337        array_push($params,substr($ymd,0,7));
    13271338    } else {
    1328         $where .= " and left(r_datetime,10) = ? ";
     1339        $where .= " and substr(r_datetime,1,10) = ? ";
    13291340        array_push($params,$ymd);
    13301341    }
     
    13351346
    13361347    $sql = "select c_member_id , count(*) as count from c_access_log";
    1337     $sql .= $where." group by c_member_id $orderby_str limit $start, $page_size";
     1348    $sql .= $where." group by c_member_id $orderby_str offset $start limit $page_size";
    13381349    $list = db_get_all($sql,$params);
    13391350    $sql = "select count(*) from c_access_log ";
     
    13891400    $params = array(intval($ktai_flag));
    13901401        if ($month_flag) {
    1391                 $where .= " and left(r_datetime, 7) = ? ";
    1392                 array_push($params,substr($ymd,0,7));
     1402            $where .= " and substr(r_datetime,1,7) = ? ";
     1403            array_push($params,substr($ymd,0,7));
    13931404        } else {
    1394                 $where .= " and left(r_datetime,10) = ? ";
    1395                 array_push($params,$ymd);
     1405            $where .= " and substr(r_datetime,1,10) = ? ";
     1406            array_push($params,$ymd);
    13961407        }
    13971408        if ($page_name!="all") {
     
    14021413    $sql .= $where;
    14031414    $sql .= " AND target_c_member_id <> 0 ";
    1404     $sql .= " group by target_c_member_id " . $orderby_str. " limit $start, $page_size";
     1415    $sql .= " group by target_c_member_id " . $orderby_str. " offset $start limit $page_size";
    14051416
    14061417    $list = db_get_all($sql,$params);
     
    14201431    $params = array(intval($ktai_flag));
    14211432        if ($month_flag) {
    1422                 $where .= " and left(r_datetime, 7) = ? ";
    1423                 array_push($params,substr($ymd,0,7));
     1433            $where .= " and substr(r_datetime,1, 7) = ? ";
     1434            array_push($params,substr($ymd,0,7));
    14241435        } else {
    1425                 $where .= " and left(r_datetime,10) = ? ";
    1426                 array_push($params,$ymd);
     1436            $where .= " and substr(r_datetime,1,10) = ? ";
     1437            array_push($params,$ymd);
    14271438        }
    14281439        if ($page_name != "all") {
     
    15141525    //page_sizeが0の時は全て表示(pagerなし)
    15151526    if ($page_size != 0) {
    1516         $limit = " LIMIT ".($page_size*($page-1)).",$page_size";
    1517     }
    1518     $where = " WHERE 1 ";
     1527        $limit = " OFFSET ".($page_size*($page-1))." LIMIT ".$page_size;
     1528    }
     1529    $where = " WHERE true ";
    15191530
    15201531    //指定された条件で絞っていく
     
    15321543    $order = " order by c_member_id";
    15331544
    1534     $sql = $select . $where . $order . $limit;
     1545    $sql = $select . $where . $order;
     1546   
    15351547    $list = db_get_all_limit($sql, 0, $limit, $params);
    15361548   
     
    15941606    );
    15951607   
    1596     $sql = "SELECT ((YEAR(CURDATE()) - birth_year)- " .
    1597         "(RIGHT(CURDATE(),5)<CONCAT(birth_month,'-',birth_day))) " .
     1608    $sql = "SELECT ((date_part('year', now()) - birth_year)- " .
     1609        "cast(substring(CURRENT_DATE,'.....$')<(to_char(birth_month, '00') || '-' || to_char(birth_day, '00')) as int)) " .
    15981610        "AS age FROM c_member WHERE birth_year <> 0;";
     1611
    15991612    $lst = db_get_all($sql);
    1600 
    16011613    $temp = array_keys($analysis_generation);
    16021614    foreach($lst as $value) {
     
    16401652function get_analysis_date_month($year = "", $month = "")
    16411653{
    1642     $sql = "select date_format(r_date,'%Y-%m') from c_member order by r_date";
     1654    $sql = "select to_char(r_date,'YYYY-MM') from c_member order by r_date";
    16431655    $start_date = db_get_one($sql);
    16441656
     
    16501662    }while($date < date("Y-m"));   
    16511663   
    1652     $sql = "select date_format(r_date,'%Y-%m') as d from c_member";
     1664    $sql = "select to_char(r_date,'YYYY-MM') as d from c_member";
    16531665    $lst = db_get_all($sql);
    16541666    foreach ($lst as $value) {
     
    16831695    }
    16841696
    1685    
    1686     $sql = "select date_format(r_date,'%d') as d from c_member where date_format(r_date,'%Y-%m') = ?";
     1697    $sql = "select to_char(r_date,'DD') as d from c_member where to_char(r_date,'YYYY-MM') = ?";
     1698   
    16871699    $params = array($date);
    16881700    $lst = db_get_all($sql,$params);
     
    17441756    $page_size = intval($page_size);
    17451757   
    1746     $where = " where 1 ";
     1758    $where = " where true ";
    17471759
    17481760    if ($keyword) {
     
    17911803    $page_size = intval($page_size);
    17921804   
    1793     $where = " where 1 ";
     1805    $where = " where true ";
    17941806
    17951807    if ($keyword) {
     
    18381850    $page_size = intval($page_size);
    18391851   
    1840     $where = " where 1 ";
     1852    $where = " where true ";
    18411853
    18421854    if ($keyword) {
     
    18851897    $page_size = intval($page_size);
    18861898   
    1887     $where = " where 1 ";
     1899    $where = " where true ";
    18881900
    18891901    if ($keyword) {
     
    19371949    $page_size = intval($page_size);
    19381950   
    1939     $where = " where 1 ";
     1951    $where = " where true ";
    19401952
    19411953    if ($keyword) {
  • OpenPNE/branches/prj/postgres/2_8_1/webapp_biz/modules/admin_biz/lib/db_admin.php

    r3057 r3402  
    167167        'caption' => $caption,
    168168        'info' => '',
    169         'is_required' => (bool)$is_required,
    170         'public_flag_edit' => (bool)$public_flag_edit,
     169        'is_required' => (int)$is_required,
     170        'public_flag_edit' => (int)$public_flag_edit,
    171171        'public_flag_default' => $public_flag_default,
    172172        'form_type' => $form_type,
    173173        'sort_order' => (int)$sort_order,
    174         'disp_regist' => (bool)$disp_regist,
    175         'disp_config' => (bool)$disp_config,
    176         'disp_search' => (bool)$disp_search,
     174        'disp_regist' => (int)$disp_regist,
     175        'disp_config' => (int)$disp_config,
     176        'disp_search' => (int)$disp_search,
    177177        'val_type' => $val_type,
    178178        'val_regexp' => $val_regexp,
     
    203203        'name' => $name,
    204204        'caption' => $caption,
    205         'is_required' => (bool)$is_required,
    206         'public_flag_edit' => (bool)$public_flag_edit,
     205        'is_required' => (int)$is_required,
     206        'public_flag_edit' => (int)$public_flag_edit,
    207207        'public_flag_default' => $public_flag_default,
    208208        'form_type' => $form_type,
    209209        'sort_order' => intval($sort_order),
    210         'disp_regist' => (bool)$disp_regist,
    211         'disp_config' => (bool)$disp_config,
    212         'disp_search' => (bool)$disp_search,
     210        'disp_regist' => (int)$disp_regist,
     211        'disp_config' => (int)$disp_config,
     212        'disp_search' => (int)$disp_search,
    213213        'val_type' => $val_type,
    214214        'val_regexp' => $val_regexp,
  • OpenPNE/branches/prj/postgres/2_8_1/webapp_biz/modules/biz/lib/mysql_functions.php

    r3224 r3402  
    232232    );
    233233
    234     $ids = db_get_col($sql, $param);
     234    $ids = db_get_col($sql, $params);
    235235
    236236    $schedule = array();
     
    336336    $sql = "SELECT * FROM biz_group_member";
    337337    $sql .= " WHERE c_member_id = ?";
    338     $sql .= " ORDER BY RAND()";
     338    $sql .= " ORDER BY RANDOM()";
    339339
    340340    $params = array(
     
    369369
    370370//指定された条件に見合うグループのリストを得る関数
    371 function biz_getGroupList($keyword = '', $page = 0, $page_size = 20, $order = 'biz_group_id')
     371function biz_getGroupList($keyword = '', $page = 0, $page_size = 20, $order = "biz_group_id")
    372372{
    373373
    374374    //keywordあり
    375375    if ($keyword) {
    376         $where = ' WHERE 1 AND (info LIKE ? OR name LIKE ?) ORDER BY ?';
     376        $where = ' WHERE true AND (info LIKE ? OR name LIKE ?) ORDER BY ' . $order;
    377377        $sql = 'SELECT * FROM biz_group'. $where;
    378378
     
    380380            '%'.$keyword.'%',
    381381            '%'.$keyword.'%',
    382             $order,
    383382        );
    384383        $list = db_get_all_page($sql, $page, $page_size, $params);
     
    386385    } else {
    387386        $where = '';
    388         $sql = 'SELECT * FROM biz_group ORDER BY ? desc';
     387        $sql = 'SELECT * FROM biz_group ORDER BY ' . $order . ' desc';
    389388
    390389        $params = array(
    391             $order,
    392390        );
    393391        $list = db_get_all_page($sql, $page, $page_size, $params);
     
    447445    if ($id) {
    448446        $params[] = intval($id);
    449         $sql = 'SELECT * FROM `biz_shisetsu_schedule` WHERE `date` = "?-?-?" AND biz_shisetsu_id = ? ORDER BY begin_time ASC';
     447        $sql = "SELECT * FROM biz_shisetsu_schedule WHERE date = '?-?-?' AND biz_shisetsu_id = ? ORDER BY begin_time ASC";
    450448    } else {
    451         $sql = 'SELECT * FROM `biz_shisetsu_schedule` WHERE `date` = "?-?-?" ORDER BY begin_time ASC';
     449        $sql = "SELECT * FROM biz_shisetsu_schedule WHERE date = '?-?-?' ORDER BY begin_time ASC";
    452450    }
    453451    $list = db_get_all($sql, $params);
     
    459457        $list[$key]['c_member_name'] = db_get_one($sql, $params);
    460458    }
    461 
    462459    return $list;
    463460}
     
    466463function biz_getShisetsuScheduleID($id)
    467464{
    468     $sql = 'SELECT * FROM `biz_shisetsu_schedule` WHERE biz_shisetsu_schedule_id = ?';
     465    $sql = 'SELECT * FROM biz_shisetsu_schedule WHERE biz_shisetsu_schedule_id = ?';
    469466
    470467    $params = array(
     
    547544    $contain = array();
    548545
    549     $sql = 'SELECT biz_schedule_id FROM biz_schedule WHERE 1 AND (begin_date LIKE \''.$y.'-'.$m.'%\' OR finish_date LIKE \''.$y.'-'.$m.'%\') AND begin_date != finish_date';
     546    $sql = 'SELECT biz_schedule_id FROM biz_schedule WHERE true AND (begin_date LIKE \''.$y.'-'.$m.'%\' OR finish_date LIKE \''.$y.'-'.$m.'%\') AND begin_date != finish_date';
    550547    $tmp = db_get_all($sql, $params);
    551548
     
    890887                                                    $id, $join_members = array())
    891888{
    892     $sql = 'UPDATE `biz_schedule` SET `title` = ?,`c_member_id` = ?,`begin_date` = ?,`finish_date` = ?,`begin_time` = ?,`finish_time` = ?,`value` = ?,`rep_type` = ?,`rep_first` = ?, `biz_group_id` = ?, `public_flag` = ?, `is_read` = 0 WHERE `biz_schedule_id` = ?';
     889    $sql = 'UPDATE biz_schedule SET title = ?,c_member_id = ?,begin_date = ?,finish_date = ?,begin_time = ?,finish_time = ?,value = ?,rep_type = ?,rep_first = ?, biz_group_id = ?, public_flag = ?, is_read = 0 WHERE biz_schedule_id = ?';
     890   
     891    //登録値のセット、チェック
     892    if (!$value) {
     893        $value = '';
     894    }
     895
     896    if (!$rep_type) {
     897        $rep_type = 0;
     898    }
     899
    893900    $params = array(
    894901        $title,
     
    907914    db_query($sql, $params);
    908915   
    909     $sql = 'DELETE FROM `biz_schedule_member` WHERE `biz_schedule_id` = ?';
     916    $sql = 'DELETE FROM biz_schedule_member WHERE biz_schedule_id = ?';
    910917    $params = array(
    911918        intval($id),
     
    934941    $sid = db_get_one($sql, $params);
    935942
    936     $sql = 'UPDATE `biz_schedule_member` SET `is_read` = \'1\' WHERE `biz_schedule_member_id` = ?';
     943    $sql = 'UPDATE biz_schedule_member SET is_read = \'1\' WHERE biz_schedule_member_id = ?';
    937944    $params = array(
    938945        intval($sid),
     
    990997    //biz_groupにデータを追加する
    991998
    992     $sql = 'UPDATE `biz_group` SET `name` = ?,`info` = ?,`image_filename` = ? WHERE `biz_group_id` = ?';
     999    $sql = 'UPDATE biz_group SET name = ?,info = ?,image_filename = ? WHERE biz_group_id = ?';
    9931000    $params = array(
    9941001        $name,
     
    10681075    }
    10691076
    1070     $sql = 'UPDATE `biz_shisetsu` SET `name` = ?,`image_filename` = ?, `info` = ? WHERE `biz_shisetsu_id` = ?';
     1077    $sql = 'UPDATE biz_shisetsu SET name = ?,image_filename = ?, info = ? WHERE biz_shisetsu_id = ?';
    10711078    $params = array(
    10721079        $name,
     
    10941101function biz_deleteShisetsuSchedule($shisetsu_id)
    10951102{
    1096     $sql = 'DELETE FROM `biz_shisetsu_schedule` WHERE biz_shisetsu_schedule_id = ?';
     1103    $sql = 'DELETE FROM biz_shisetsu_schedule WHERE biz_shisetsu_schedule_id = ?';
    10971104    $params = array(
    10981105        intval($shisetsu_id),
     
    11141121        $writer_name = '';
    11151122    }
    1116 
     1123   
     1124    if ($due_datetime == '') {
     1125        $due_datetime = '0000-01-01';
     1126    }
     1127   
     1128    if ($biz_group_id == '') {
     1129        $biz_group_id = 0;
     1130    }
     1131   
    11171132    $data = array(
    11181133        'c_member_id' => $member_id,
     
    11461161    }
    11471162   
    1148     $sql = 'UPDATE `biz_todo` SET `c_member_id` = ?, `memo` = ?, `writer_id` = ?,'
    1149         .'`r_datetime` = ?, `due_datetime` = ?, `priority` = ?, `biz_group_id` = ?,'
    1150         .'`public_flag` = ? WHERE `biz_todo_id` = ?';
     1163    $sql = 'UPDATE biz_todo SET c_member_id = ?, memo = ?, writer_id = ?,'
     1164        .'r_datetime = ?, due_datetime = ?, priority = ?, biz_group_id = ?,'
     1165        .'public_flag = ? WHERE biz_todo_id = ?';
    11511166
    11521167    $params = array(
     
    11871202    if ($is_check) {
    11881203    //チェックを解除する
    1189         $sql = 'UPDATE `biz_todo` SET `is_check` = \'0\' WHERE `biz_todo_id` = ?';
     1204        $sql = 'UPDATE biz_todo SET is_check = \'0\' WHERE biz_todo_id = ?';
    11901205    } else {
    11911206    //チェックをつける
    1192         $sql = 'UPDATE `biz_todo` SET `is_check` = \'1\' WHERE `biz_todo_id` = ?';
     1207        $sql = 'UPDATE biz_todo SET is_check = \'1\' WHERE biz_todo_id = ?';
    11931208    }
    11941209
     
    12611276function biz_deleteGroupImage($id, $filename)
    12621277{
    1263     $sql = 'UPDATE `biz_group` SET `image_filename` = \'0\' WHERE `biz_group_id` = ?';
     1278    $sql = 'UPDATE biz_group SET image_filename = \'0\' WHERE biz_group_id = ?';
    12641279    $params = array(
    12651280        intval($id),
     
    12711286function biz_deleteShisetsuImage($id, $filename)
    12721287{
    1273     $sql = 'UPDATE `biz_shisetsu` SET `image_filename` = \'0\' WHERE `biz_shisetsu_id` = ?';
     1288    $sql = 'UPDATE biz_shisetsu SET image_filename = \'0\' WHERE biz_shisetsu_id = ?';
    12741289
    12751290    $params = array(
     
    12831298function biz_changeNickname($member_id, $new)
    12841299{
    1285     $sql = 'UPDATE `c_member` SET `nickname` = ? WHERE `c_member_id` = ?';
     1300    $sql = 'UPDATE c_member SET nickname = ? WHERE c_member_id = ?';
    12861301    $params = array(
    12871302        $new,
     
    13031318    biz_deleteShisetsuImage($id, $shisetsu['image_filename']);
    13041319
    1305     $sql = 'DELETE FROM `biz_shisetsu` WHERE biz_shisetsu_id = ?';
     1320    $sql = 'DELETE FROM biz_shisetsu WHERE biz_shisetsu_id = ?';
    13061321    $params = array(
    13071322        intval($id),
Note: See TracChangeset for help on using the changeset viewer.