Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Sorry, I thought you had names spanning fields, not the reverse. You can't pass the "total name" and make it work. You'll have to search each field.
  2. How is a total over 1000 complicated for a machine?
  3. You could store minutes.
  4. Yup... add a new DATE column, convert using STR_TO_DATE(), then drop the old one, and then mysql date math is a joke.
  5. Ignoring for the time being that this is likely a poor storage choice, you can build this pseudo-structure in advance, and then just interpolate a simple string. But that's a php syntax question.
  6. If you're talking about including HTML in a field, this has nothing to do with either php or mysql... just dump out the contents as-is (assuming you're not messing around with entities and such). Otherwise, if you want to link the entire record to something, you'll need another field. And no, phpmyadmin doesn't know anything about either of these.
  7. Yes, you'll need to run "SELECT LAST_INSERT_ID()" afterwards, but not a true mysql query.
  8. fenway

    Please help!!

    And what's wrong? Other than a poor choice for a title?
  9. If the file is a reasonable size, you can extract the field in a text editor -- otherwise, sed and grep are your friends.
  10. Sounds like you need to clean up your database.
  11. Not really... now you've posted (1) a query that won't work with multiple keywords and (2) a query that's not valid at all. My comment referred to your original query, mixing ANDs and ORs without parentheses.
  12. Oh, it is VERY necessary -- don't kid yourself.
  13. LIKE won't return anything useful... you'll have to count either in mysql or application code.
  14. Read the refman on LAST_INSERT_ID() with with a parameter -- very cool, mostly unknown functionality, explicitly for this purpose.
  15. Well, if you want that history, you have to store it somewhere.
  16. Define "most".
  17. Like I said earlier, just dupe the record.
  18. But this kind of thing should never be done in the query itself. Get the value, get the count, and have the script output them as you please.
  19. hard to graph text, but sure. You simply need to duplicate your records instead of overwriting them.
  20. Persistent connections are evil... open/close once per script, and don't write poor queries that take a long time to execute. Bandwidth for most queries is not an issue.
  21. You don't have parens where you should have them.
  22. FULLTEXT will ignore most of these characters, but comes with it's own issues.
  23. Well, that version of mysql can only use one index per query, so having "lots of indexes" won't help. Besides, no matter what you do, skipping ~17000 rows just to show 20 is crazy slow -- ALWAYS.
  24. Actually, you can write it this way: SELECT @rank := @rank +1 AS rank, userid, percent FROM ranking, ( SELECT @rank := 0 ) t1 ORDER BY percent DESC And not have to worry about it.
×
×
  • 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.