Subversion-Projekte lars-tiefland.shop_ns

Revision

Revision 9 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 9 Revision 11
Zeile 1... Zeile 1...
1
<?php
1
<?php
2
        $index = 9;
2
    $indexes = array(
-
 
3
        1,
-
 
4
        2,
-
 
5
        3,
-
 
6
        4,
-
 
7
        5,
-
 
8
        6,
-
 
9
        7,
-
 
10
        8,
-
 
11
        9,
-
 
12
        );
3
	mysql_connect("localhost","root","voyager");
13
    mysql_connect( "localhost", "root", "voyager" );
4
	mysql_select_db("mediaran_de");
14
    mysql_select_db( "mediaran_de" );
-
 
15
    foreach ( $indexes as $index )
5
	$sql="
16
    {
6
	    SELECT
17
        $sql = "SELECT
7
	        id,
18
                id,
8
	        preis$index
19
                preis$index
9
	    FROM
20
            FROM
10
	        artikel
21
                artikel
11
	´   WHERE
22
            WHERE
12
	        father > 0
23
                father > 0
13
	    AND
24
            AND
14
	        preis$index <> 0
25
                preis$index <> 0
15
	";
26
        ";
16
	$res = mysql_query($sql);
27
        $res = mysql_query( $sql );
17
	while($row=mysql_fetch_assoc($res))
28
        while ( $row = mysql_fetch_assoc( $res ) )
18
	{
29
        {
19
	    echo "Artikel " . $row["id"] . "\n";
30
            echo "Artikel " . $row["id"] . "\n";
20
	    unset($staffel);
31
            unset( $staffel );
21
	    $staffel["menge"][0] = 0;
32
            $staffel["menge"][0] = 0;
22
	    $staffel["preis"][0]=$row["preis".$index];
33
            $staffel["preis"][0] = $row["preis" . $index];
23
            $staffel = serialize($staffel);
34
            $staffel = serialize( $staffel );
24
	    $sql_i="
35
            $sql_i = "
25
	        INSERT INTO
36
                INSERT INTO
26
		    preise
37
                    preise
27
		SET
38
                SET
28
		    preis_index = $index,
39
                    preis_index = $index,
29
		    artikel = ".$row["id"].",
40
                    artikel = " . $row["id"] . ",
30
		    staffel = '".mysql_real_escape_string($staffel)."'
41
                    staffel = '" . mysql_real_escape_string( $staffel ) . "'
31
            ";
42
            ";
32
	    $res_i = mysql_query($sql_i);
43
            $res_i = mysql_query( $sql_i );
-
 
44
        }
33
	}
45
    }
34
?>
46
?>