Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. What, exactly, the query you're worried about?
  2. Why 12 columns of teams?
  3. "SELECT e.event,e.time,e.img,e.vid,e.status,e.added, c.contact FROM $tab[contacts] AS c INNER JOIN $tab[events] AS e ON ( e.user = c.contact ) WHERE c.user='$id' ORDER BY e.time"
  4. If SQL isn't in existence, then the $sql variable won't be useful for the query -- which is exactly what it's an ideal choice. You should name variables based on what they contain, not based on what they're used for.
  5. That's PHP code -- not SQL queries -- I mean the actual statement that the server will execute.
  6. @ebmigue: How so? That will do precisely what the OP requested -- find all products that have 2 matching attributes.
  7. Just use all_games for now.
  8. Across tables? I suppose you could use the information_schema to determine which tables contain a given field -- but why on earth would you want to do this?
  9. TLDR -- what's the current problem?
  10. That's php code, not a mysql query. Also, why not just use a JOIN?
  11. The row sampling link I gave you is precisely what you're looking for....
  12. Show us raw queries and error messages, not just the latter.
  13. Since each project is functionally distinct, it makes logical sense to keep them distinct at the database level as well -- so 6 DBs. And as long as the mysql users have acccess to both DBs, and they're on the same machine, another connection is not a big deal. And like I said earlier, concerns about scaling are premature.
  14. SELECT p.* FROM Products AS p CROSS JOIN ProdAts AS a1 CROSS JOIN ProdAts AS a2 WHERE ( a1.attribute = '23' AND a1.product = p.id ) AND ( a2.attribute = '45' AND a2.product = p.id )
  15. Ah, I see -- you'll need to use a GROUP BY to find the set you want, and then join back. LIMIT 1 was an easy workaround that limits functionality.
  16. I meant in terms of scalability... this need not concern you at this stage, you'll just get lost in subjective opinions -- every case is different. Go with InnoDB, and don't use separate databases if you want to share anything. If anything, you can store the users in their own table, and use project prefixes -- or, if you want, separate project DBs and a users DB.
  17. "select distinct email, date and group by email" really should be "select email, date and group by email, date". Don't use DISTINCT -- it's evil.
  18. Yes, but we're talking about variable NAMES, not variable IDENTIFIERS -- so it's only beneficial to the human in question. And it matters even if you're not working on a team -- going back into 5-year-old code and trying to guess what a variable holds is all but impossible. A simple convention will save you hours.
  19. @abamaca -- post your query.
  20. Over 500? How did this random list of IDs get generated?
  21. Try the CSV engine type.
  22. Those sizes are screaming for another table.
  23. Sorry, I don't follow.
×
×
  • 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.