Advertisement
Guest User

Kategorien einfügen.

a guest
Sep 16th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. $db = 'xxxx';
  4. $server = 'xxxxxxxxxxxxx';
  5. $user = 'xxxxxx';
  6. $pw = 'xxxxxxx';
  7.    
  8. $con = new mysqli($server, $user, $pw);
  9.  
  10.     if(mysqli_connect_errno())
  11.     {
  12.         printf("Verbindung fehlgeschlagen: %s" . mysqli_connect_error());
  13.         exit();
  14.     } else {
  15.             echo "Erfolgreich verbunden!!!<br>";
  16.             $con->select_db($db);
  17.            
  18.         }
  19.                        
  20.  
  21. $hauptkategorie = 1;
  22.  
  23. for($hauptkategorie = 1; $hauptkategorie <= 7; $hauptkategorie++){
  24.     $i = 1;
  25.     while($i <= 5){
  26.  
  27.     $query = 'INSERT INTO `xt_categories` (
  28.     `categories_id` ,
  29.     `external_id` ,
  30.     `permission_id` ,
  31.     `categories_owner` ,
  32.     `categories_image` ,
  33.     `parent_id` ,
  34.     `categories_status` ,
  35.     `categories_template` ,
  36.     `listing_template` ,
  37.     `sort_order` ,
  38.     `products_sorting` ,
  39.     `products_sorting2` ,
  40.     `top_category` ,
  41.     `date_added` ,
  42.     `last_modified` ,
  43.     `google_product_cat`
  44.     )
  45.     VALUES (
  46.     "0", NULL , "0", "1", NULL , ' .$hauptkategorie . ', "1", "", "", "0", "", "", "0", NULL , "2013-09-14 20:22:23", "New"
  47.     )';
  48.  
  49.     $con->query($query);
  50.  
  51.     $i++;
  52.     }  
  53. }
  54.  
  55.  
  56. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement