Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
#!/usr/bin/perl
2
 
3
use DBI;
4
 
5
#my $db = DBI->connect('DBI:mysql:content_management','root','k-gg-4-y-zz');
6
my $db = DBI->connect('DBI:mysql:content_management','admin','WE-nw-1044');
7
 
8
my $query = "select distinct webs.datenbank from webs_properties,webs where (webs_properties.properties between 220 and 225) and (webs.ID = webs_properties.webs)";
9
my $db_output = $db->prepare($query);
10
$db_output->execute;
11
 
12
while (@wert=$db_output->fetchrow_array)
13
{
14
    for ($i = 1; $i <= 8; $i++)
15
    {
16
	    $condition="(autoupdate".$i." < NOW()) and (autoupdate".$i." > '0000-00-00 00:00:00')";
17
 
18
        $update_query="update $wert[0].artikel set letzte_Aenderung_von = concat(letzte_Aenderung_von,' (autoupdate)') where (letzte_Aenderung_von not like '%(autoupdate)') and ".$condition;
19
        $db->do("$update_query") || print $db->errstr;
20
 
21
        $update_query="update $wert[0].artikel set preis".$i."=preis_neu".$i.", preis_neu".$i."='NULL', autoupdate".$i." = '0000-00-00 00:00:00' where ".$condition;
22
        $db->do("$update_query") || print $db->errstr;
23
    }
24
}
25
 
26
$db->disconnect;