| 1 |
lars |
1 |
<?
|
|
|
2 |
require_once "../connect.php";
|
|
|
3 |
|
|
|
4 |
$query = "SELECT DISTINCT
|
|
|
5 |
webs.datenbank,
|
|
|
6 |
webs.db_server,
|
|
|
7 |
webs.db_username,
|
|
|
8 |
webs.db_password
|
|
|
9 |
FROM
|
|
|
10 |
webs_properties,
|
|
|
11 |
webs
|
|
|
12 |
WHERE
|
|
|
13 |
webs_properties.properties BETWEEN 220 AND 225
|
|
|
14 |
AND
|
|
|
15 |
webs.ID = webs_properties.webs
|
|
|
16 |
AND
|
|
|
17 |
webs.domain='$site'
|
|
|
18 |
";
|
|
|
19 |
$result = mysql_query( $query ) or die( mysql_errno() . ": " .
|
|
|
20 |
mysql_error() . "<hr>" . $query );
|
|
|
21 |
|
|
|
22 |
while ( $zeile = mysql_fetch_assoc( $result ) )
|
|
|
23 |
{
|
|
|
24 |
$conn = mysql_connect( $zeile["db_server"], $zeile["db_username"], $zeile["db_password"], true );
|
|
|
25 |
for ( $i = 1; $i <= 8; $i++ )
|
|
|
26 |
{
|
|
|
27 |
$condition = "(autoupdate" . $i . " < NOW()) and (autoupdate" .
|
|
|
28 |
$i . " > '0000-00-00 00:00:00')";
|
|
|
29 |
|
|
|
30 |
$update_query = "update " . $zeile["datenbank"] .
|
|
|
31 |
".artikel set letzte_Aenderung_von = concat(letzte_Aenderung_von,' (autoupdate)') where (letzte_Aenderung_von not like '%(autoupdate)') and " .
|
|
|
32 |
$condition;
|
|
|
33 |
mysql_query( $update_query, $conn );
|
|
|
34 |
|
|
|
35 |
$update_query = "update " . $zeile["datenbank"] .
|
|
|
36 |
".artikel set preis" . $i . "=preis_neu" . $i .
|
|
|
37 |
", preis_neu" . $i . "='NULL', autoupdate" . $i .
|
|
|
38 |
" = '0000-00-00 00:00:00' where " . $condition;
|
|
|
39 |
mysql_query( $update_query, $conn );
|
|
|
40 |
}
|
|
|
41 |
}
|
|
|
42 |
?>
|