Commit 35d16f82257b7dcd1d02f64323f30a7633588bcc

Authored by mukhtar
1 parent 2e0b6a00

no message


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@884 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/store.php
... ... @@ -80,7 +80,8 @@ for ($i = 0; $i < count($aKeys); $i++) {
80 80 $sRowStart = $aKeys[$i];
81 81  
82 82 $iColumnCount++;
83   - }
  83 + }
  84 +
84 85  
85 86 if ($iPrimaryKey < 0) {
86 87 //perform an insert
... ... @@ -138,7 +139,7 @@ for ($i = 0; $i &lt; count($aKeys); $i++) {
138 139 //perform an update
139 140 $sQuery = "UPDATE $sTableName SET ";
140 141 for ($j = 0; $j < count($aColumns) -1; $j++) {
141   - $sQuery .= $aColumns[$j] . " = ";
  142 + $sQuery .= $aColumns[$j] . " = ";
142 143 switch ($aTypes[$j]) {
143 144 case 0:
144 145 //id
... ... @@ -147,15 +148,15 @@ for ($i = 0; $i &lt; count($aKeys); $i++) {
147 148 case 1:
148 149 $sQuery .= "'" . addslashes($aValues[$j]) . "', ";
149 150 break;
150   - case 2:
151   - $sQuery .= $aValues[$j] . ", ";
  151 + case 2:
  152 + $sQuery .= ($aValues[count($aTypes) -1] ? 1 : 0) . ", ";
152 153 break;
153 154 case 3:
154 155 $sQuery .= $aValues[$j] . ", ";
155 156 break;
156 157 default:
157 158 break;
158   - }
  159 + }
159 160 }
160 161 $sQuery .= $aColumns[count($aTypes) -1] . " = ";
161 162 switch ($aTypes[count($aTypes) -1]) {
... ...