Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. And you can't use an expression as a default.
  2. My advice pertained to SELECT queries only.
  3. Blank screen = PHP error == wrong forum.
  4. This is basically a variant on counting rows based a given column value -- you'll have to use user variables.
  5. I don't see why you need it in "a single row, while loop" -- who cares? Besides, it's easier to write as two subqueries, though there is a fancy way to get this in a single query.
  6. Nope -- add a "modified" column, and use magical timestamp or insert it yourself (the latter is preferable).
  7. Actually, not solved -- you're storing dates as VARCHAR -- not DATE -- use a proper format.
  8. You're not escaping special characters.
  9. Without the parens, that's valid syntax... but it's not very efficient.
  10. fenway

    Insert next id

    Besides, NULL in an auto-increment field will just insert the next number in sequence anyway. And why would you duplicate information across columns????
  11. That's not technically correct -- use LIMIT 0, and it most cases, nothing will happen, but the parser will still have to validate the query.
  12. Not "all" of the info -- just the non-matching records. After all, you did say LEFT JOIN.
  13. Huh?
  14. Still don't see why there can't be a single pre-existing meeting table.
  15. What kind of words?
  16. You're talking about storing hierarchical data -- not trivial, many tutorials around, including on the stickyl
  17. Assuming you have an index on your timestamp column, you're at the limit.
  18. Why not do this in a single SQL statement?
  19. Yes... and I believe I alluded to this earlier. Simply run this query as a derived table, and use MAX().
  20. I can't follow that.
  21. First, you get a resultset back from mysql_query() -- that's a hash, not a scalar. Second, why not use a join?
  22. UNION then COUNT(*)?
  23. fenway

    ORDER BY inputs

    I think thorpe meant: SELECT ID, Location FROM tbl ORDER BY FIELD(Location, 'New York'); But careful if there are non-matching value.
×
×
  • 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.