Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7758041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:15:14+00:00 2026-06-01T13:15:14+00:00

I’m working on the datafeed script for my Affiliate program and really thought I

  • 0

I’m working on the datafeed script for my Affiliate program and really thought I was “doin’ it” but when I run the script it creates the CSV file with only 7 of 28 products. Prior to testing I made all the products meet the conditions of the query so they all should be included.I even removed the stock level and price conditions. Still only 7 of 28 gets added to the csv file 5 from one category and 2 from the other. There are only 5 products in the first category and all of those are returned. But only 2 of the 23 in the second category are returned.

The Goal is to get the specific data for all products from the categories in the query and dump them into a csv file.

This is my first time trying to write a more complex sql query (for a beginner anyway).

Using print_r I found the problem is my query. I thought I had this working before. The difference between when it was working and now is that I included grabbing the categoryid and catparentid. But even if I remove these additions, I still get the same results. Now I’m thinking that I might have thought it was working before on my larger database of products but perhaps it actually wasn’t returning all of the products but because there were so many I thought they were.

The full script is pretty long but I created a new script below just to see if the query is even grabbing all of the records… it’s not. 🙁

If I run a query to check for unassociated products (i.e. ones that have no category associations), all products are associated with a category.

All of the products have image & brand associations so I don’t think that’s the issue either.

Even if I remove the Where clause altogether, only the 7 products are grabbed.

I also ran the query directly within the database and got the same thing:

Showing rows 0 - 6 ( 7 total, Query took 0.0029 sec)

SELECT isc_products.productid, isc_products.prodcode, isc_products.prodname, isc_products.produrl, isc_products.prodcalculatedprice, isc_products.proddesc, isc_products.prodcurrentinv, isc_products.upc, isc_categories.categoryid, isc_categories.catparentid, isc_categories.catname, isc_product_images.imagefilestd, isc_product_images.imagefilethumb, isc_brands.brandname
FROM isc_products
INNER JOIN isc_categories ON isc_products.prodcatids = isc_categories.categoryid
INNER JOIN isc_product_images ON isc_products.productid = isc_product_images.imageprodid
INNER JOIN isc_brands ON isc_products.prodbrandid = isc_brands.brandid
WHERE isc_categories.categoryid =10
OR isc_categories.categoryid =12

Could there be any special characters in the data that would cause this issue?

Or am I using the inner joins incorrectly?

<pre>
<?php

// Make a MySQL Connection
mysql_connect("localhost", "myusername", "mypassword") or die(mysql_error());
mysql_select_db("mydatabase") or die(mysql_error());


$result = mysql_query("SELECT isc_products.productid, 
isc_products.prodcode,
isc_products.prodname,
isc_products.produrl,
isc_products.prodcalculatedprice,
isc_products.proddesc,
isc_products.prodcurrentinv,
isc_products.upc,
isc_categories.categoryid,
isc_categories.catparentid,
isc_categories.catname, 
isc_product_images.imagefilestd,
isc_product_images.imagefilethumb,
isc_brands.brandname
FROM isc_products 
INNER JOIN isc_categories 
ON isc_products.prodcatids = isc_categories.categoryid 
INNER JOIN isc_product_images 
ON isc_products.productid = isc_product_images.imageprodid 
INNER JOIN isc_brands 
ON isc_products.prodbrandid = isc_brands.brandid 
WHERE isc_categories.categoryid = 17
OR isc_categories.categoryid = 15
OR isc_categories.categoryid = 16
OR isc_categories.categoryid = 12
OR isc_categories.categoryid = 13
OR isc_categories.categoryid = 14
OR isc_categories.categoryid = 11
OR isc_categories.categoryid = 10
AND isc_products.prodcurrentinv > 1
AND isc_products.prodcalculatedprice > 1.00
ORDER BY isc_categories.catname
")
or die(mysql_error());


while($row = mysql_fetch_array( $result)){
print_r ($row);
}





// end of file
echo '<br/>****** Script successfully run! ******';
?>
</pre>

Any thoughts on this would be appreciated. Dislcaimer if your first thought is “Why didn’t you…” It’s because I didn’t or don’t know about it. 🙂 One day, my friend… one day I will. hahahaha

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:15:16+00:00Added an answer on June 1, 2026 at 1:15 pm

    Try replacing the inner join with LEFT JOIN, then look at the results. Do you see the 28 you expect? If so (or you see more), the join is incorrect in some way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.