Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22
  1. #21
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Quick help with MySQL Query - Selecting OLD Product at Random

    Quote Originally Posted by Jeff_Mash View Post
    However, when I request to return other information (like the product NAME, the product IMAGE, things that I need for my other function), then the results returned give me some duplicates.
    Your duplicates are because you're joining multiple tables but not accounting for mismatched joins.
    I built my suggestions based on you saying you wanted product_ids. Not complete product details. I assumed since you were only returning 1 item in your examples that you were intending to do a separate query for the rest of any truly needed data.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #22
    Join Date
    Aug 2004
    Posts
    762
    Plugin Contributions
    0

    Default Re: Quick help with MySQL Query - Selecting OLD Product at Random

    Quote Originally Posted by DrByte View Post
    Your duplicates are because you're joining multiple tables but not accounting for mismatched joins.
    I built my suggestions based on you saying you wanted product_ids. Not complete product details. I assumed since you were only returning 1 item in your examples that you were intending to do a separate query for the rest of any truly needed data.
    I understand, and THANK YOU for the help. I hope my previous reply didn't insinuate that your query was not what I has asked for. I simply used that as a "base" to modify and add more parameters to return fields from the database (like product name, image, etc). That was when I noticed it wasn't as easy as asking for those fields in the query.
    - Jeff

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. v155 Help with a MySQL query
    By lat9 in forum General Questions
    Replies: 7
    Last Post: 26 Apr 2016, 10:11 PM
  2. help with database query selecting manufacturers
    By bn17311 in forum General Questions
    Replies: 1
    Last Post: 23 Apr 2015, 08:54 AM
  3. Need help with a mySQL Query
    By jeffmic in forum General Questions
    Replies: 3
    Last Post: 19 Dec 2010, 02:21 PM
  4. Help for mysql query!!
    By g.nencini in forum General Questions
    Replies: 2
    Last Post: 13 Jul 2009, 05:32 AM
  5. Help with Random Code appearing in Product List
    By Oozle in forum General Questions
    Replies: 10
    Last Post: 29 May 2009, 03:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR