Index: /branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
===================================================================
--- /branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	(revision 19731)
+++ /branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	(revision 19732)
@@ -1274,5 +1274,5 @@
         $rank = $objQuery->get("rank", $table, $where, array($id));
         // ランクの最大値を取得
-        $maxrank = $objQuery->max($table, "rank", $andwhere);
+        $maxrank = $objQuery->max("rank", $table, $andwhere);
         // ランクが最大値よりも小さい場合に実行する。
         if($rank < $maxrank) {
@@ -1356,5 +1356,5 @@
         $rank = $objQuery->get("rank", $tableName, $getWhere, array($keyId));
 
-        $max = $objQuery->max($tableName, "rank", $where);
+        $max = $objQuery->max("rank", $tableName, $where);
 
         // 値の調整（逆順）
@@ -1493,5 +1493,5 @@
         // 新カテゴリでの登録処理
         // 新カテゴリの最大ランクを取得する。
-        $max_rank = $objQuery->max($table, "rank", "$cat_name = ?", array($new_catid)) + 1;
+        $max_rank = $objQuery->max("rank", $table, "$cat_name = ?", array($new_catid)) + 1;
         $where = "$id_name = ?";
         $sqlup = "UPDATE $table SET rank = ? WHERE $where";
Index: /branches/version-2_5-dev/data/class/SC_Query.php
===================================================================
--- /branches/version-2_5-dev/data/class/SC_Query.php	(revision 19731)
+++ /branches/version-2_5-dev/data/class/SC_Query.php	(revision 19732)
@@ -513,5 +513,5 @@
      * @return integer MAX文の実行結果
      */
-    function max($table, $col, $where = "", $arrval = array()) {
+    function max($col, $table, $where = "", $arrval = array()) {
         $ret = $this->get($table, "MAX($col)", $where, $arrval);
         return $ret;
@@ -527,5 +527,5 @@
      * @return integer MIN文の実行結果
      */
-    function min($table, $col, $where = "", $arrval = array()) {
+    function min($col, $table, $where = "", $arrval = array()) {
         $ret = $this->get($table, "MIN($col)", $where, $arrval);
         return $ret;
Index: /branches/version-2_5-dev/data/class/batch/SC_Batch_Daily.php
===================================================================
--- /branches/version-2_5-dev/data/class/batch/SC_Batch_Daily.php	(revision 18820)
+++ /branches/version-2_5-dev/data/class/batch/SC_Batch_Daily.php	(revision 19732)
@@ -96,5 +96,5 @@
 
         // 最後に更新された日付を取得
-        $ret = $objQuery->max("dtb_bat_order_daily", "create_date");
+        $ret = $objQuery->max("create_date", "dtb_bat_order_daily");
         list($batch_last) = split("\.", $ret);
         $pass = $now_time - strtotime($batch_last);
Index: /branches/version-2_5-dev/data/class/db/SC_DB_MasterData.php
===================================================================
--- /branches/version-2_5-dev/data/class/db/SC_DB_MasterData.php	(revision 18701)
+++ /branches/version-2_5-dev/data/class/db/SC_DB_MasterData.php	(revision 19732)
@@ -181,7 +181,7 @@
 		
         // 指定のデータを追加
-       	$sqlVal[$columns[0]] = $key;            
+       	$sqlVal[$columns[0]] = $key;
         $sqlVal[$columns[1]] = $value;
-        $sqlVal[$columns[2]] = $this->objQuery->max($name, $columns[2]) + 1;        
+        $sqlVal[$columns[2]] = $this->objQuery->max($columns[2], $name) + 1;
         $sqlVal[$columns[3]] = $comment;
         $this->objQuery->insert($name, $sqlVal);
Index: /branches/version-2_5-dev/data/class/pages/admin/system/LC_Page_Admin_System_Input.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/system/LC_Page_Admin_System_Input.php	(revision 19670)
+++ /branches/version-2_5-dev/data/class/pages/admin/system/LC_Page_Admin_System_Input.php	(revision 19732)
@@ -367,5 +367,5 @@
         $sqlVal['password']    = sha1($arrMemberData['password'] . ':' . AUTH_MAGIC);
         $sqlVal['authority']   = $arrMemberData['authority'];
-        $sqlVal['rank']        = $objQuery->max('dtb_member', 'rank') + 1;
+        $sqlVal['rank']        = $objQuery->max('rank', 'dtb_member') + 1;
         $sqlVal['work']        = '1'; // 稼働に設定
         $sqlVal['del_flg']     = '0'; // 削除フラグをOFFに設定
Index: /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment_Input.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment_Input.php	(revision 19711)
+++ /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment_Input.php	(revision 19732)
@@ -200,5 +200,5 @@
             // INSERTの実行
             $sqlval['creator_id'] = $_SESSION['member_id'];
-            $sqlval['rank'] = $objQuery->max("dtb_payment", "rank") + 1;
+            $sqlval['rank'] = $objQuery->max("rank", "dtb_payment") + 1;
             $sqlval['create_date'] = 'Now()';
             $sqlval['payment_id'] = $objQuery->nextVal('dtb_payment_payment_id');
Index: /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Kiyaku.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Kiyaku.php	(revision 19670)
+++ /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Kiyaku.php	(revision 19732)
@@ -153,5 +153,5 @@
         $sqlval['kiyaku_text'] = $arrData['kiyaku_text'];
         $sqlval['creator_id'] = $_SESSION['member_id'];
-        $sqlval['rank'] = $objQuery->max("dtb_kiyaku", "rank") + 1;
+        $sqlval['rank'] = $objQuery->max("rank", "dtb_kiyaku") + 1;
         $sqlval['update_date'] = "Now()";
         $sqlval['create_date'] = "Now()";
Index: /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Delivery_Input.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Delivery_Input.php	(revision 19686)
+++ /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Delivery_Input.php	(revision 19732)
@@ -225,5 +225,5 @@
             $deliv_id = $objQuery->nextVal('dtb_deliv_deliv_id');
             $sqlval['deliv_id'] = $deliv_id;
-            $sqlval['rank'] = $objQuery->max("dtb_deliv", "rank") + 1;
+            $sqlval['rank'] = $objQuery->max("rank", "dtb_deliv") + 1;
             $sqlval['create_date'] = 'Now()';
             // INSERTの実行
Index: /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Holiday.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Holiday.php	(revision 19670)
+++ /branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Holiday.php	(revision 19732)
@@ -159,5 +159,5 @@
         $sqlval['day'] = $arrData['day'];
         $sqlval['creator_id'] = $_SESSION['member_id'];
-        $sqlval['rank'] = $objQuery->max("dtb_holiday", "rank") + 1;
+        $sqlval['rank'] = $objQuery->max("rank", "dtb_holiday") + 1;
         $sqlval['update_date'] = "Now()";
         $sqlval['create_date'] = "Now()";
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php	(revision 19729)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php	(revision 19732)
@@ -276,5 +276,5 @@
             // ROOT階層で最大のランクを取得する。
             $where = "parent_category_id = ?";
-            $rank = $objQuery->max("dtb_category", "rank", $where, array($parent_category_id)) + 1;
+            $rank = $objQuery->max("rank", "dtb_category", $where, array($parent_category_id)) + 1;
         } else {
             // 親のランクを自分のランクとする。
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php	(revision 19729)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php	(revision 19732)
@@ -285,5 +285,5 @@
                 // ROOT階層で最大のランクを取得する。
                 $where = "parent_category_id = ?";
-                $sqlval['rank'] = $objQuery->max("dtb_category", "rank", $where, array($sqlval['parent_category_id'])) + 1;
+                $sqlval['rank'] = $objQuery->max("rank", "dtb_category", $where, array($sqlval['parent_category_id'])) + 1;
             } else {
                 // 親のランクを自分のランクとする。
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Maker.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Maker.php	(revision 19670)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Maker.php	(revision 19732)
@@ -150,5 +150,5 @@
         // INSERTする値を作成する。
         $sqlval['name'] = $arrData['name'];
-        $sqlval['rank'] = $objQuery->max("dtb_maker", "rank") + 1;
+        $sqlval['rank'] = $objQuery->max("rank", "dtb_maker") + 1;
         $sqlval['creator_id'] = $_SESSION['member_id'];
         $sqlval['update_date'] = "Now()";
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php	(revision 19729)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php	(revision 19732)
@@ -180,5 +180,5 @@
             $sqlval['class_id'] = $_POST['class_id'];
             $sqlval['creator_id'] = $_SESSION['member_id'];
-            $sqlval['rank'] = $objQuery->max("dtb_classcategory", "rank", $where, array($_POST['class_id'])) + 1;
+            $sqlval['rank'] = $objQuery->max("rank", "dtb_classcategory", $where, array($_POST['class_id'])) + 1;
             $sqlval['create_date'] = "now()";
             $sqlval['update_date'] = "now()";
Index: /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Class.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Class.php	(revision 19729)
+++ /branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Class.php	(revision 19732)
@@ -153,5 +153,5 @@
         $sqlval['name'] = $arrData['name'];
         $sqlval['creator_id'] = $_SESSION['member_id'];
-        $sqlval['rank'] = $objQuery->max("dtb_class", "rank") + 1;
+        $sqlval['rank'] = $objQuery->max("rank", "dtb_class") + 1;
         $sqlval['create_date'] = "now()";
         $sqlval['update_date'] = "now()";
