osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Multi images extra by nico

This is a discussion on Multi images extra by nico within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; the query return zero records when the products_images table don't have the product_id record I made a modification in the ...



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Welcome to osCMax Join osCMax Now! Download osCMax Here
Reply

 

LinkBack Thread Tools
  #1  
Old 08-29-2008, 10:02 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 13,401
Thanks: 112
Thanked 472 Times in 414 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Multi images extra by nico

the query return zero records when the products_images table don't have the product_id record
I made a modification in the query to get info even if products_images is empty

replace original query
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");


by:
$product_info_query = tep_db_query("SELECT
p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity,
p.products_image,pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id,
pi.products_image1, pi.products_image2, pi.products_image3, pi.products_image4, pi.products_image5,
pi.products_image6, pi.products_image7, pi.products_image8, pi.products_image9
FROM ".TABLE_PRODUCTS." as p
LEFT JOIN ".TABLE_PRODUCTS_DESCRIPTION." as pd ON (pd.products_id = p.products_id)
LEFT JOIN ".TABLE_PRODUCTS_IMAGES." as pi ON (pi.products_id = p.products_id)
WHERE p.products_status = '1'
AND p.products_id = '".(int)$HTTP_GET_VARS['products_id']."'
AND pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);

More...
__________________
Michael Sasek
osCMax Developer

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Multi images extra by nico michael_s New osCommerce Contributions 0 07-23-2008 10:01 AM
Multi images extra by nico michael_s New osCommerce Contributions 0 04-19-2008 08:01 PM
How to load multi images ozstar osCMax v2 Installation issues 4 04-15-2008 05:59 PM
Extra Images michael_s New osCommerce Contributions 0 06-26-2007 08:10 AM
Extra Images michael_s New osCommerce Contributions 0 04-27-2007 09:36 PM


All times are GMT -8. The time now is 04:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax