Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. A few things: 1) You don't need to have two duplicate indexes for "id" -- PRIMARY KEY will suffice, drop the other one. 2) You should really index the fields you're using for JOIN. 3) because it's a left join, you need to make any conditions from the where clause of the left join-ed table to the ON clause.
  2. You've posted a ton of code... TLDR.
  3. It might be faster to determine the "dominant" language in a subquery for each....
  4. Well, you can use user variables for this task... but I still don't see why you can't use a multi-pass approach in php.
  5. Unlikely... you have a lot of multiple values being stored in single fields -- you should read some of the stickies on normalization.
  6. You only want products that have both terms? It's probably easier to find the matching rows and then join them to each other...
  7. There are plenty of excellent resources in the stickies... you don't have to google for them.
  8. Is that true even if you've set the server/client time zones appropriately? I haven't tried...
  9. I'm not sure I understand... PHP offers a simple interface to run mysql commands, as does PHPMyAdmin.
  10. I really hope that table is generated dynamically....
  11. IDs should *ALWAYS* be linkable... why wouldn't they be?
  12. That's one of the stickies, BTW.
  13. Faster then a left join... unlikely. Let's see the EXPLAIN output for each one.
  14. Yet another reason to possibly switch forum software? this isn't their first time.
  15. Yes, it's correct.
  16. Yup... it's called a LEFT JOIN.
  17. I'm not sure what you mean...
  18. fenway

    Easy query?

    You'll have to "join" all the way up the chain -- which is difficult without a loop, SPs, or pre-existing knowledge. There's a sticky on hierarchical data.
  19. Well, in the first set of queries, you're just inserting the results of a left join.. is null -- so that should be easy enough. In the second set, it's essentially a 3 table join.
  20. Well, I can't do anything else without your table structures, since I can't execute the query on my end -- nor have you provided your version number.
  21. you should be able to write multi-table versions of both the insert and the updat.
  22. There are tons of examples if you search this forum or read the commments on the relevant mysql refman page.
  23. Huh? What re you trying to? Check for multiple family names?
  24. If only we knew the mysql version, as is required by the forum posting rules.... :0(
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.