Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. In fact, mysql is quite lax, and will happily match up date with date/time fields even without DATE() wrapping.
  2. You can use: INSERT INTO yourTable( col1, col2, col3 ) SELECT c3, 'foo', c4, 'bar' FROM ..... WHERE .... As you had done earlier....
  3. And what do you want?
  4. No, i don't mean insert --- i saw select/update in your code.
  5. Thanks for reading between the lines. I just get tired of having to deal with some of mysql's more annoying features -- like leaving off ONLY_FULL_GROUP_BY in the sql mode, allowing resetting of the auto-increment counter without truncate, etc.
  6. There's a lot of junk in the server code.
  7. You can actually just use NOW()... no need for wrapping in DATE().
  8. yes, you need a left join: select * from players as p left join medicalward as m on ( m.player_id = p.id ) where p.City_ID=? and m.player_id is null ORDER BY RAND() Limit 20
  9. I suggest you copy my example, not yours ;-)
  10. Why not use a multi-table update?
  11. It gets even more complicated since it's also a function. It's just a bad idea to use it.
  12. I'm assuming that all of this is happening when mysqld is shutdown... What about "isamchk -e -a -i -o"? The error 17 is really bothering me... are you running this as a privileged user?
  13. OK... let's cover what you *can* do with the data. [As for the backup, I didn't mean a mysql dump... i meant a physical copy of the files in question, in case we destroy them in the process.] What errors/messages do you get from "force-recover"?
  14. MAX(path)??? Don't you mean: select filename, path, max(revision) from repos group by filename, path;
  15. No, you can't insert into multiple tables at once. But you can use LAST_INSERT_ID() (I'm sure there's an equivalent php function) to get the new photoID. You obviously know userId already.
  16. "Show create table" will tell you what it is.
  17. No, you need to do: ALTER TABLE yourTable CHANGE oldColName newColName <column def> But you NEED to make sure you use the exact same column defn as current exists.
  18. It's usually the default OS temp dir -- see here
  19. It can't auto-update a record that isn't there.
  20. There are some ways to rename without using alter, but don't use them... bad form.
  21. What exactly did you change? post table structure.
  22. You can easily join the tables or use subqueries to pull those values.
  23. Please echo $sql and post it here.
  24. Also, why run two update queries? why not: mysql_query("UPDATE users SET on='ON',ip='$ip' WHERE username = '$username'");
×
×
  • 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.