Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Yeah, don't use reserved keywords for column names.
  2. Hmm... COALESCE() will return the first non-null value it finds, but that would mean you'd need to get the rows "joined" together first.
  3. Maybe I'm not understanding what you're trying to "count".
  4. You can't upload "using" mysql -- that doesn't make any sense.
  5. What do those rows represent?
  6. Well, you need to insert the newly linked "pair" of IDs into the "junction" table, as you call it.
  7. Like a temporary table?
  8. Do tell.
  9. Yikes... why not just GROUP BY month?
  10. That's great! So post it here for everyone else's benefit.
  11. You can't check a field from a left joined table if it doesn't match, since it will be NULLed out. Move this to the ON clause: SELECT DISTINCT a.`store_id`, a.`store_name`, b.`fax` FROM `order_item` AS a INNER JOIN `store` AS b ON ( b.`store_id` = a.`store_id` ) LEFT JOIN `order_fax_status` AS c ON (c.`store_id` = a.`store_id` AND c.`fax_status` != 'SUCCESS' ) WHERE a.`od_id` = 3 AND a.`store_id` <> 1000
  12. You didn't upper() product.
  13. Well, it supported extended ASCII as well... and you'd need to use CHAR_LENGTH() with multi-byte collations.
  14. mysql_query() returns a resource... not sure what you're expecting without calling fetch_array(). Also, that script is vulnerable to sql injection. Maybe you should take a look at some of the stickies that have tutorials.
  15. Then I'm confused... why not simply join the tables?
  16. You'd have to make sure you handled the boundary cases, where there was more than a single space in the field.
  17. Why are you storing "mixed" data that way?
  18. TLDR... you're new here, so maybe you haven't taken the time to read the rules/TOS -- posting scripts is frowned upon. What exactly is the specific issue here?
  19. Since your scripts can't be "psychic", you need to "store" the news_id from the most recent Page 1 submission. Your DB will not help you here.
  20. Is there data that wold violate the constraint already in the table?
  21. First, please don't post all of your code -- just the relevant code snippet. Second, how is the a mysql problem?
  22. DATEDIFF( yourField, NOW() )
  23. latin1 handles the standard ASCII character set... nothing more.
  24. OK, that's quite enough... if you want to write php scripts, I'll move this to the PHP Help section. The SQL variant was already posted... you guys decide.
  25. This is a very common issue... usually it means the other half of the FK does not match the new part that you're re-creating. Also, why didn't you just rename them?
×
×
  • 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.