function ad_channel_update_6001 in Advertisement 7
Same name and namespace in other branches
- 6.3 channel/ad_channel.install \ad_channel_update_6001()
- 6.2 channel/ad_channel.install \ad_channel_update_6001()
Populate the ad_priority table.
File
- channel/
ad_channel.install, line 191
Code
function ad_channel_update_6001() {
$ret = array();
$result = db_query('SELECT a.aid, p.priority FROM {ads} a LEFT JOIN {ad_priority} p ON a.aid = p.aid');
while ($ad = $result
->fetch()) {
if (!isset($ad->priority)) {
$ret[] = update_sql("INSERT INTO {ad_priority} (aid, priority) VALUES ({$ad->aid}, 0)");
}
}
return $ret;
}