Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. fenway

    query help..

    Well, a NULL into a non-null decimal field would return 0.00.
  2. And why the UNION -- are you actually running this once per UID?
  3. Then I don't understand what you're trying to do.
  4. And what is that code trying to calculate?
  5. Emphasis added. Personally, I see absolutely nothing wrong with leaving orphans rows lying around -- makes fixing accidental user errors so much easier. Through, granted, with InnoDB, you can get screwed with UID re-use -- I always hated that.
  6. I simply meant to say that any record deleted by "ON DELETE CASCADE" won't trigger any DELETE triggers on the cascaded tables.
  7. I don't understand what you're trying to query.
  8. If you're getting PHP syntax errors, you're in the wrong forum.
  9. Also, cascaded actions won't trigger other triggers, so it's only a cascade in the most basic sense.
  10. Don't you mean INNER JOIN? You want matching ones only, right?
  11. Dependent subqueries -- avoid. Derived tables are subject to the same performance if they're derived or not.
  12. I suppose you could use a derived table to get the photo counts for each such user.
  13. The truth is, you can just count the rows that you get back -- there's no LIMIT clause -- so why the second query at all?
  14. If EntryDate were a TIMESTAMP, MySQL would handle the timezones for you.
  15. I've covered this before -- the GROUP BY / HAVING solution is incredibly slow on large tables. Just CROSS JOIN, once for each condition.
  16. Trigger cascading is fraught will difficulties
  17. First, don't bump. Second, you can't just tack on a count(*) like that -- it's meaningless. You'll need another query -- don't be lazy.
  18. That's just lots of PHP. Post the actual query and the actual error.
  19. If that's what you want, just sort the string yourself before you insert into
  20. In general, you can always try "deleting" a user by just adding a "2" to the username -- that way, you don't have to re-create anything when you're wrong.
  21. That doesn't make any sense -- try again.
  22. That's not a query, that's php.
  23. Using NULLs with date ranges is annoying, but you can store all zeroes.
  24. Then you need to store the product order in the session.
×
×
  • 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.