Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. TEXT is evil because it silently forces mysql to make a temporary table for group by / sorting operations... amongst other evil things.
  2. And you're checking this after how long? What kinds of queries? Have you read this yet? Or this?
  3. That's the only solution.
  4. Hence my conditional statement above Right, that...
  5. No ideas... I don't see a single mysql statement.
  6. Some table structure would help.
  7. fenway

    Which types?

    I use DOUBLE. DOUBLE is terrible for monetary values -- floating-point error hell. In v5+, VARCHAR can be up to 65K -- much, much better than TEXT for about 15 different reasons. And as for yes/no, I question your db design.
  8. Or any of the stickes on this board.
  9. If it is not required to store the values in single column then aschk solution is best. If not, you can use an expression... but that's slow too.
  10. And why the left join?
  11. fenway

    JOIN help

    This is very clearly a double-post -- topic locked.
  12. fenway

    SELECT

    Ugh... a subquery with NOT IN... definitely use aschk's code.
  13. VARCHAR is now up to 65K in v5 -- almost no need to ever use TEXT, which is *very* evil.
  14. Are you sure that you make sure all the counters where at zero before you started this analysis?
  15. This should be fine: SELECT *, DATE_FORMAT( mytimedatefield1, '%d-%m-%Y' ) as pretty1, DATE_FORMAT( mytimedatefield2, '%d-%m-%Y' ) as pretty2, DATE_FORMAT( mytimedatefield3, '%d-%m-%Y' ) as pretty3 FROM mytable WHERE id=12")
  16. If you use Barand's alternative, you had better stick in a meaningful order by clause... also, be aware that if the recordset is changed, your numbering will be off.
  17. Then you'll have to "number" *all* of the rows.
  18. Yeah, that... you have to check them "sequentially"... if the start is between, then make sure end isn't, etc.
  19. I usually have a payments table where I hold all of the "final" details that go out for payment processing... this table also has fields for all of the "incoming" data too.
  20. sorry, I'm a bit out of it today... you can simply combine both of those where clause with an OR. WHERE ( arrival_date BETWEEN '$arrival_date' AND '$departure_date' ) OR ( departure_date BETWEEN '$arrival_date' AND '$departure_date )
  21. Definitely just a single payments table... all cc transactions have a similar format (i.e. # of fields returned).
  22. You can't use between for this... you have to check them separately.
  23. I've used type_uid and table_type in tandem before... sometimes you can cheat with specific ranges.
  24. "multiple records with the same field name" == what does this mean?
  25. You could always use and order by clause and some user variables.
×
×
  • 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.