Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You're checking for either non-matching rows.
  2. Impossible to tell -- too little information.
  3. Always good to add an extra column, test that (with an equality, make sure there all the rows "match"), and then drop the old one.
  4. You never "really need to" -- don't pick an arbitrary name to begin with.
  5. You shouldn't even need to rename your tables -- don't even give yourslef that option.
  6. Like I said before, you can't use * in RIGHT() like that.
  7. SELECT table2 INNER JOIN table2 USING ( ClientID )
  8. What does the mysql error log say?
  9. I don't know that it's going to help -- it's still "blocking" -- what version do you have?
  10. You're looking for INSERT... ON DUPLICATE KEY UPDATE.
  11. Actually, that only works when selecting, when I use 'DELETE' rather than 'SELECT *' it throws a syntax error? #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN `RSCEmulation`.`users` ON (`RSCEmulation`.`rscd_bank`.`owner` = `RSCEm' at line 1 Right, you'll need to start with: DELETE `RSCEmulation`.`rscd_bank`.* FROM .... Regarding the other queries -- INSERT usually can't be optimized. Can't say much about the others without seeing the accompanying EXPLAIN for each one -- which is tricky for delete. You can "set := ... " in the same statement, as a subquery, but that's just a legibility thing.
  12. fenway

    Wildcard?

    If you have a DB wrapper, maybe. But it's a simple for() loop to generate the SQL -- which I hope you're not writing by hand....
  13. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=341737.0
  14. but that would be telling the secret *shudder*
  15. Don't post your entire script. Echo the $sql variable.
  16. IDs "ending" in specific values? Why???
  17. Please don't use giant bold fonts. Echo the sql statement you think isn't working.
  18. Glad to help -- there's the Donate button if you're feeling generous.
  19. DELETE FROM `RSCEmulation`.`rscd_bank` LEFT JOIN `RSCEmulation`.`users` ON ( `RSCEmulation`.`rscd_bank`.`owner` = `RSCEmulation`.`users`.`id` ) WHERE `RSCEmulation`.`users`.`id` IS NULL;
  20. Did you try a LEFT JOIN?? NOT IN() is usually very, very slow.
  21. I mean dump the strings that those queries represent.
  22. Yes, but that's a hack -- why are you queries so slow?
  23. Echo the queries.
  24. You can't use SELECT * in a subselect like 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.