Menu

adding colors to 1000 items and not dying :x

Help 2.02
2004-07-25
2004-08-16
  • ricardo roman

    ricardo roman - 2004-07-25

    tries to do relating it directly data in the tables color and colorinfo but he is very extensive,
    also "size" in the module admin/IMPORT but ...
    Q031; Q031; 1.000; gramo; 0.104347; "color1,color2,color3"; ; ; 1; 2; 1; cordones/q031t.jpg; cordones/q031d.jpg;short ; long; 2

    .....

    it adds the values, but without "newid" in "size" table, and not them load within the description of items..  :(

    somebody can helpme?????

     
    • Andreas Kansok

      Andreas Kansok - 2004-07-26

      You have to 'copy' the lines for importing size and sizeinfo only and replace 'size' with 'color':
      admin/importitem.inc.php lines 48-57 and 71-83.

      Greetings,
      Andreas.

       
    • ricardo roman

      ricardo roman - 2004-08-16

      return error:

      126 (126; 20.869565 US; neu; Column count doesn't match value count at row 1 Column count doesn't match value count at row 1 uno Column count doesn't match value count at row 1 dos )

      some idea ?

       
    • ricardo roman

      ricardo roman - 2004-08-16

                db_query("INSERT into color values('%','$nitemID', '$data[6]', '$data[7]','$newid')") or db_die();
                $color_res = db_query("select ID from color where newid='$newid'") or db_die();
                $color_row = db_fetch_row($color_res);
                $colorinfo_array = explode(",", $data[5]);
                foreach($colorinfo_array as $colorinfo_row) {
                  db_query("INSERT into colorinfo values('%', '$color_row[0]', '$nlangID', '$colorinfo_row')") or db_die();
                  echo "$colorinfo_row ";
                }
                echo ")\n";
                db_query("update color set newid='0' where ID='$color_row[0]'") or db_die();
              }

       
      • Andreas Kansok

        Andreas Kansok - 2004-08-16

        Seems copy was not enough :-(

        Modify both INSERT-queries and set column names:
        INSERT INTO color (itemID, newid) VALUES ($nitemID, $newid)

        INSERT INTO colorinfo (colorID, langID, value) VALUES ($color_row[0], $nlangID, $colorinfo_row)

        In original script $data[5] - [7] contain values for first property (sizes). You should add your color values at the of the line.
        $colorinfo_array = explode(",", $data[16]);

        Otherwise all indexes in import script have to be modified.

        Greetings,
        Andreas.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.