Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You have to decide how similar to want simialr to be, then write your own function to do it.... or look at a 3rd party soluion.
  2. I assume you mean InnoDB... which doesn't do table locks.
  3. It's supposed to be enabled by default... what's the output of SHOW ENGINES?
  4. Yes, having a parent_id works, for the root node (i.e. the top), set it to NULL (better than 0). To query it, you simply need to know how many levels you want, and join the same table in that many times.
  5. Not exactly what I asked for... :-( What determined the value of $Expired? You're quoting it, so you'll never manage to get NULL in there.
  6. You need to add another left join, and check where the join condition column IS NULL.
  7. Well you should always specify the table name/alias when retrieving columns... but in this case, you want to use a column alias... e.g. field1 AS MyFavField.
  8. I can't read that... what are you actually trying to do?
  9. You need to join the colors table twice (untested): SELECT i.*, ci.color_name AS c1, ce.color_name AS c2 FROM items AS i INNER JOIN colors AS ci ON ( i.internal_color_id = ci.id ) INNER JOIN colors AS ce ON ( i.external_color_id = ce.id ) WHERE i.item_id = 100
  10. And you want the max points per game_id?
  11. Just joining in now... which part doesn't work?
  12. So are these: http://msdn2.microsoft.com/en-us/library/bb250448.aspx http://www.bazon.net/mishoo/articles.epl?art_id=824
  13. Post your table structure -- but you need a simply group by with max() on the table.
  14. The left join is correct, just add a where clause.
  15. Sorry... then you need '$input'.
  16. You can't ask MAX() to do something other than get the maximum value -- it can't magically figure out which user has this maximum value. You'll need to get the list of users and max's first, then join this to your primary query.
  17. You mean the *root* password...?
  18. Your column name is for? That's a reserved keyword -- you'll need to wrap it in backticks (which phpmyadmin does for you), or better yet, change it.
  19. This is typical AJAX DB functionality.
  20. Check out the sticky on normalization and the dev article inside on storing hierarchal data.
  21. fenway

    SQL Help

    Yes, I see that... that's why you're having trouble.
  22. Read the stickies on optimization.
  23. Are there any queries in the slow-query-log? What are server parameters like? It's not the size.
  24. The question is really if you ever query column2 without column1.
  25. Yes, you've posted that many times... post JUST the two update queries.
×
×
  • 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.