Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You want an UPDATE statement, not an INSERT.
  2. DISTINCT happens too late. I'm not sure I understand what you want to SUM -- if there are multiple payments for each client, don't you want all of them?
  3. What is your query so far?
  4. The latter method you describe is the most efficient... but it gets complicated if you need to join this, or if you want more than 1 record back.
  5. Sure, why not a simple update statement?
  6. If it was MyISAM, just marked for deletion, and the table wasn't optimized, then maybe with a hex editor.
  7. Confirmed -- it wouldn't make much sense to change it because you wouldn't be able to connect to it change it if it was off.
  8. The OP sounds like the PK won't be numeric.
  9. OK... post the table structures (from SHOW CREATE TABLE) and some sample data, and I'll see what I can cook up... this is getting to complicated to follow, explains without queries, etc.
  10. Post the table structure... what indexes do you have?
  11. Well, that does explain why you're getting multiple values... do you really want * back? Is the * from the "1" table or the "many" table?
  12. Do you have magic_quotes enabled?
  13. You need single quotes around $TODAY, not backticks.
  14. I told you how to do this... have you tried?
  15. YEARMONTH is a valid EXTRACT format for dates.
  16. MySQL has an excellent dev article on this (the list adjacency model) -- have you explored this option?
  17. If that's the case, add a third table, with a (song_id, album_id) record for each pair.
  18. OK, I see what you mean. First, why the LEFT JOIN? Second, if you try COUNT(*), is it any better?
  19. You need to build you where clause dynamically in php.
  20. Barand usually makes pretty diagrams... but I'm too lazy :-) You shouldn't use a tracklist field -- you should have a table for tracks and a table for albums, and then include an album_id in the songs table.
  21. You write a bunch of individual query, and then then join them together... "derived" tables, as it were. I don't have time now, maybe later on this evening I will try and work with your schema.
  22. I feel like you're asking the PHP version of this question...
  23. Is this a 1-to-1 relationship?
  24. Sure, whatever you say.
  25. Hopefully this presentation will stay online at scribd... it's simply fantastic, probably the best I've come across in recent memory. At 220 slides, it's quite lengthy -- but the lessons learned are invaluable, so be sure to read all the way to the end. A MUST READ!!!! EDIT: This year's version of the presentation -- some really great stuff in here, particuarly about hierarchies.
×
×
  • 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.