Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Reports or Function Needed


kester

Recommended Posts

Posted

Hello all..

 

I was wondering if anyone had the code to create a list (plain text) of products with the image missing (the image field is filled in with a file name but the file doesn't exist).

 

Also, could this function/report be changed to list all products with the price field empty?

 

I'm working with a few thousand products entries, so going through each one-by-one would take much too long. Any help is appreciated.

 

~k

Posted

if (isset($product_image) && __________________ ) {

echo $product_model;

}

 

 

____________ = file system command (product image exists)

Posted

i'm editting the stats_products_viewed.php report to accomplish the list, but i still don't know how to compare to the file system... pls hlp.

Posted

use phpmyadmin or so and use this SQL query

 

SELECT * FROM products WHERE products_image=''

 

if you have the big images mod also installed then

 

products_bimage

 

SELECT * FROM products WHERE products_image='' || products_bimage = ''

 

or write it into a file somewhere you need it

tep_db_query(...);

Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Posted

thanks for the reply druide, but the problem i'm having is not with the sql statement, it is isolating the broken image links.

Posted
$q = mysql_query('select * from products');

while($p = mysql_fetch_array($q)){

//product image path in db, but no actual file

 if(isset($p['products_image']) && !file_exists('/home/user/www/catalog/'.$p['products_image'])) {

   echo $p['products_id'].' '.$p['products_model'].'<br>';

 }

//products price can't be null. check versus 0, the default;

 if($p['products_price'] == 0.0000) {

   echo $p['products_id'].' '.$p['products_model'].'<br>';

 }

}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...