comparison createdb.php @ 72:63a6caf59e5c

Fix creation of boolean settings, and add '%b' formatter into stPrepareSQL().
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 17 Oct 2013 15:01:20 +0300
parents 23eba98e1575
children c70c2650f790
comparison
equal deleted inserted replaced
71:d74fb8cf0062 72:63a6caf59e5c
213 { 213 {
214 switch ($value[0]) 214 switch ($value[0])
215 { 215 {
216 case VT_TEXT: $type = "%s"; $var = "vtext"; break; 216 case VT_TEXT: $type = "%s"; $var = "vtext"; break;
217 case VT_STR: $type = "%s"; $var = "vstr"; break; 217 case VT_STR: $type = "%s"; $var = "vstr"; break;
218 case VT_BOOL: $type = "%B"; $var = "vint"; break; 218 case VT_BOOL: $type = "%b"; $var = "vint"; break;
219 case VT_INT: $type = "%d"; $var = "vint"; break; 219 case VT_INT: $type = "%d"; $var = "vint"; break;
220 } 220 }
221 221
222 $sql = stPrepareSQL( 222 $sql = stPrepareSQL(
223 "INSERT INTO settings (key,vtype,".$var.",desc) VALUES (%s,%d,".$type.",%s)", 223 "INSERT INTO settings (key,vtype,".$var.",desc) VALUES (%s,%d,".$type.",%s)",