Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. As listed, KEY is just a plain old index -- no "constraint" of any type.
  2. ...Did you miss the scrollbars? No, I didn't -- that's not SQL, that's PHP.
  3. Yes, INNER JOIN.
  4. Also, at no point did you actually share the query with us.
  5. FYI, you can't mix GROUP BY and those columns that way.
  6. Simple question -- are you using a DB class, or are you coding each sql statement yourself? If it's the latter, you're likely vulnerable.
  7. Or just a subquery.
  8. Closure tables are a less painful option.
  9. No, I don't provide "full code". There are countless examples on this forum of using user variables as counters.
  10. I like nested sets -- but they're slightly annoying to maintain (parent, depth, ancestor, etc.).
  11. Are there errors now?
  12. But that's always the case, whether it's 1 table or 4 -- you can't know what's in the other table until you look.
  13. ...assuming the permissions are set up correctly -- LOCAL isn't allowed by default.
  14. Why don't those additional tables have an article_uid?
  15. Sure -- use SUBSTRING_INDEX().
  16. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=343905.0
  17. That link is precisely how to do it. Of course it's advanced -- you're asking an for advanced query. You had the option of just running it N times, but you didn't like that.
  18. Yeah, you have to do weird stuff with NULLs -- easier to use use "WHERE confirm <> 'y' or confirm is NULL".
  19. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=343851.0
  20. You're asking to retrieve N records per group -- yes, that's possible, and efficiently, too. See here.
  21. You don't need the column names per se -- just change it to: INSERT INTO `brand` VALUES (1,'No Brand','No Brand','no-brand.jpg',0,NULL),(2,'686','686','686.jpg',0,NULL), ...... And you're done.
  22. Then you might as well number them in PHP -- or, if you insist, use user variables in mysql.
  23. You're trying to assign rank in mysql? There are dozens of tutorials. You're just asking for a counter, right?
  24. There aren't matching rows in the proposal_files table -- that what I asked originally -- so obviously the query won't work. You need to check your data more carefully before you ask for help with a query that you think is "broken".
  25. Assuming you know the column names, and know that they're in right order, it's a multi-valued insert statement.
×
×
  • 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.