Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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:)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...