Rename Product Image in SQL Query Oscommerce

How to Rename Product Image in SQL Query in osCommerce.
In Oscommerce it is simple to rename the product image in sql query. IN the below is the simple script to sove this
  $products_query = tep_db_query("select * from products");
  while ($products_values = tep_db_fetch_array($products_query)) 
 $products_id = $products_values['products_id'];
 $products_image = $products_values['products_image'];
 $image = $products_image.'.jpg';
 //echo $image;
 //echo $products_id;
 //echo $products_image;
 $sql = "update products set products_image = '" .$image ."' where products_id = '" . (int)$products_id . "'";
 $update_query = tep_db_query($sql); 

Make a php file using this code and run it……….
Good Luck.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *