Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You can extract MONTH_YEAR from any date column.
  2. Mysql is very limited in this capacity - LIKE %$yourString%, FULLTEXT indexing, your own custom index table or a third-party plugin are pretty much the only way to go.
  3. There is no such thing as an "MD5 column type" or equivalent -- nor should there be, because that would require sending the raw, plaintext value unencrypted to the DB... which is undesriable.
  4. Echo the query.
  5. There are a few ways to deal with this... do you really need to look though all of the posts? Or just the ones in the last hour/day/week? That would simplify matters a great deal.
  6. fenway

    SQL Help

    SHOW TABLE STATUS.
  7. Why would you do anything of the sort? Issue two separate queries... and deal with in PHP.
  8. I'm sure there is a lot of info you can ask paypal to "send back" to you... ENUM ('Male','Female') and ENUM( 'Yes','No' ) are examples of correct syntax.
  9. It means that you can't have a WHERE clause in an INSERT statement. Look here.
  10. I would ask my you're chaning the UID value... but I can't explain it.
  11. fenway

    Query

    I'm not sure I understand.. you want to limit the values to today? Any given day?
  12. OUTFILE normally resides on the server... different set of permissions....
  13. First, re-write the query using JOIN syntax: ELECT k.* FROM keywords k JOIN titles_keywords tk1 ON ( tk1.keyword_id=k.id ) JOIN titles_keywords tk2 ON ( tk1.title_id=tk2.title_id ) JOIN titles_keywords tk3 ON ( tk3.keyword_id=tk2.keyword_id ) WHERE tk1.keyword_id=$user_keyword_id AND tk3.title_id!=tk1.title_id GROUP BY k.id ORDER BY k.schlagwort Post the EXPLAIN output from both queries and we'll take it from there.
  14. What is producing that error text?
  15. There are entire books written on this subject.
  16. There is no INSERT INTO where with values!!! You need to use INSERT INTO.. .SELECT ... WHERE and write a proper query... but it sounds like the poster wanted an update anyway.
  17. Even so, when did they buy the tickets? How many? Confirmation #? etc. ENUM requires a list of possible values; check the refman for syntax.
  18. As I see it, the real problem -- which I didn't notice before -- is that you're using DISTINCT. That's effectively a GROUP BY -- which means that any non-aggregate column (in this case, postnum) will contain meaningless information not related to the aggregate column (in this case, author). You can't really do this and expect to get meaningful results.
  19. Sorry, didn't notice that you were using the expression "distance" in your order by clause... that's the "real" problem.
  20. ID (Must be unique, starting with 00001, id should increment by 1) -PK, auto_increment, BIGINT UNSIGNED, deal with the zerofill on the output only, no in the DB Name -varchar, 255 Gender (Male or female) -ENUM Contact Number -varchar,255 -- unless you can be sure you're only storing north american numbers, in which case CHAR(10) is sufficient Email Address -varchar,255 Time Of Registration -store date & time, in the DATETIME() field, use NOW() on INSERT IP -UNSIGNED INT, store with INET_ATON() -- don't store the dotted octet Paid (Yes/No) -ENUM... but it seems like it's missing lots of info (when, how much, for what, etc.) Could use some normalization when there are more fields. At the very least, index name -- but that really should be first and last separately, right?
  21. How fast can you recite the alphabet backwards? It is flipping the *results*, that's why it's expensive.
  22. No key usage with DESC.
  23. First , you DO NOT need to lock the tables -- LAST_INSERT_ID() is thread-safe. Second, all you need in SELECT LAST_INSERT_ID() ... that's it. Also, there's a php function for this purpose, too.
  24. There is no way to fix the size of the table (well, in InnoDB, you could exceed it)... something else funny (non-mysql related) is going on.
  25. Internal server error is likely from missing headers; something to do with the script itself, not mysql.
×
×
  • 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.