function imagepicker_update_6202 in Image Picker 6.2
File
- ./
imagepicker.install, line 250 - imagepicker install, update and uninstall functions
Code
function imagepicker_update_6202() {
$ret = array();
$sql = "ALTER TABLE {imagepicker} ADD img_date_new INT UNSIGNED NOT NULL DEFAULT 0 AFTER img_description";
$ret[] = update_sql($sql);
$sql = "SELECT img_id, img_date FROM {imagepicker}";
$result = db_query($sql);
while ($row = db_fetch_array($result)) {
$newdate = strtotime($row['img_date']);
$sql = "UPDATE {imagepicker} SET img_date_new = '" . $newdate . "' WHERE img_id = " . $row['img_id'] . "";
$result2 = db_query($sql);
}
$sql = "ALTER TABLE {imagepicker} DROP img_date";
$ret[] = update_sql($sql);
$sql = "ALTER TABLE {imagepicker} CHANGE img_date_new img_date INTEGER UNSIGNED NOT NULL DEFAULT '0' AFTER img_description";
$ret[] = update_sql($sql);
return $ret;
}