- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
CREATE TABLE `pm_keywords` (
`id` int(11) unsigned NOT NULL auto_increment,
`keyword` varchar(255) default NULL,
....
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_keyword` (`keyword`),
) ;"
$sql = "SELECT keyword
FROM pm_keywords
WHERE active = 0
ORDER BY rand()
LIMIT ".intval($newKeywords);
$q = mysql_query($sql);
$keywords = array();
while ($r = mysql_fetch_assoc($q)) {
$keywords[] = mysql_real_escape_string($r['keyword']);
}
$newKeywordsActual = count($keywords);
$sql = "UPDATE `pm_keywords` SET
active = 1,
lastupdate = '".date('Y-m-d H:i:s')."'
WHERE keyword IN ('".implode("','", $keywords)."')
LIMIT ".$newKeywordsActual;
mysql_query($sql);
murz 25.02.2010 11:43 # 0
HyperGeek 25.02.2010 12:09 # 0
murz 25.02.2010 12:17 # 0
wwwguru 01.03.2010 01:12 # +1
murz 01.03.2010 10:41 # 0
wwwguru 01.03.2010 14:33 # 0
murz 01.03.2010 15:41 # 0
live 05.03.2010 16:46 # 0