Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. I don't understand.
  2. What you need to do is get the max entry_id for each "set", then join this back to the original table.
  3. The only way to make the table name dynamic is to use a stored procedure.
  4. I'm confused... mysql grant table easily handle wildcard IPs.
  5. Not sure... those don't look like mysql errors.
  6. Why do this in the db?
  7. Open that .sql file and look at line 1.
  8. There's a whole sticky dedicated to this topic on this forum.
  9. VARCHAR is 65K in mysql5.0.3+ -- much better choice than TEXT. Aside: the 5.1 refman page is still wrong on the mysql docs.
  10. I think I understand now... if you have a unique index on your destination table, then an INSERT INTO... ON DUPLICATE KEY UPDATE... will allow you "overwrite" all the entires. Of course, you'll have to use a derived table to get the most recent first.
  11. Well, MySQL doesn't know that... so you'll have no choice but to do this in PHP.
  12. Perhaps you should look at InnoDB ACID transactions.
  13. Other than the missing column list for TABLE_B, not really... could you post some sample data & table structures?
  14. Sorry, I entirely missed that when I read the query... my bad. When there are const join conditions, my brain has issues. Generally, I write those as follows to make my brain hurt less: SELECT a.fvalue as fname, b.fvalue as lname, c.fvalue as empID FROM user2 AS a JOIN user2 AS b ON (b.uid = a.uid AND b.fid = 2 ) JOIN user2 AS c ON (c.uid = a.uid AND c.fid = 3 ) WHERE a.fid = 1 AND a.uid = 2
  15. To each his own... but if I'm not using an ON clause, then I like to be explicit so that I don't think it's a mistake.
  16. I never used "JOIN" as a bareword... it's always INNER, LEFT, or CROSS. The first two require (or should, IMHO) an ON clause -- so I expect to see one right away. The last one doesn't -- I use it when trying to find multiple matches in a many-to-many table -- so I use CROSS JOIN to indicate that the specified value will be in the where clause. Basically, my rule is like this: if the "join" compares two DB fields, it goes in an ON clause; otherwise, it goes in a WHERE clause while referencing a constant (e.g. for CROSS JOIN). Obviously, LEFT JOIN is sometimes an exception. Besides, why not stick to standard SQL whenever possible?
  17. Using CROSS JOIN makes the purpose of the JOIN explicit....
  18. MySQL handles them quite differently... and VARCHAR acts like CHAR in many temporary operations, so space does matter for performance. That being said, if you need to store large amounts reguarly, use VARCHAR(65k).
  19. I'm very confused.. .you're using GROUP BY (again, no point for DISTINCT) -- so what do you think it's going do? Import all the data first, then aggregate it!
  20. Did you try using mysqli_multi_query()? I'd read this PHP bug report too.
  21. I will say again -- a few lines of php to check the current time both on display of the page and on POST will solve your problem.
  22. Don't use LONGTEXT... VARCHAR in MYSQL5 can store up to 65K, which is usually sufficient.
  23. If you have old data stored in another collation, then yes, you have to fix that.
×
×
  • 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.