Jump to content

Sassa

Members
  • Content count

    2
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Sassa Wicky
  • Gender
    Female
  1. Hi I hope someone can help me. I want to transfer my images from a previous contributions "Extra images - http://addons.oscommerce.com/info/1289". I've tried to alter the sql accordingly below that I found in a previous post but have not succeeded. require('includes/application_top.php'); $sess_id = (tep_not_null(SID)); $sql_raw = 'select products_id, products_image_array, products_image, products_subimage1, products_subimage2, products_subimage3, products_subimage4, products_subimage5, products_subimage6 from ' . TABLE_PRODUCTS; $product_query = tep_db_query($sql_raw);$n=0; while ($products = tep_db_fetch_array($product_query)) { $products_image_array = unserialize($products['products_image_array']); if (!is_array($products_image_array)) $products_image_array = array(); for ($i = 1; $i <= 6; ++$i) { $image = $products['products_subimage' . $i]; if (tep_not_null($image)) { $products_image_array[] = $image; $n++; } } $sql_data_array['products_image_array'] = serialize($products_image_array); tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products['products_id'] . "'"); } die("<center><br><br><b>Completed image transfer process, transfered " . $n . " product images to Multi Image Add-On data array.</b></center><br><br>"); ?> My image links are in a separate table called "products_extra_images" and the columns are products_id products_extra_image products_extra_images_id Have tried everything but nothing works. Sorry for my bad English, hope you understand me:)
  2. Sassa

    Transfer images

    Hi I hope someone can help me. I want to transfer my images from a previous contributions "Extra images - http://addons.oscommerce.com/info/1289". I've tried to alter the sql accordingly below that I found in a previous post but have not succeeded. require('includes/application_top.php'); $sess_id = (tep_not_null(SID)); $sql_raw = 'select products_id, products_image_array, products_image, products_subimage1, products_subimage2, products_subimage3, products_subimage4, products_subimage5, products_subimage6 from ' . TABLE_PRODUCTS; $product_query = tep_db_query($sql_raw);$n=0; while ($products = tep_db_fetch_array($product_query)) { $products_image_array = unserialize($products['products_image_array']); if (!is_array($products_image_array)) $products_image_array = array(); for ($i = 1; $i <= 6; ++$i) { $image = $products['products_subimage' . $i]; if (tep_not_null($image)) { $products_image_array[] = $image; $n++; } } $sql_data_array['products_image_array'] = serialize($products_image_array); tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products['products_id'] . "'"); } die("<center><br><br><b>Completed image transfer process, transfered " . $n . " product images to Multi Image Add-On data array.</b></center><br><br>"); ?> My image links are in a separate table called "products_extra_images" and the columns are products_id products_extra_image products_extra_images_id Have tried everything but nothing works. Sorry for my bad English, hope you understand me:)
×