Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Reports or Function Needed


kester

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

$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>';

 }

}

 
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...