Jump to content

maxxd

Gurus
  • Posts

    1,698
  • Joined

  • Last visited

  • Days Won

    53

Everything posted by maxxd

  1. product_inventory has an FK (product_location_id) to product_locations, which includes both the location ID and the product ID. product_locations.stock is used only for the stock at the actual time of the transaction - product_inventory is for historical inventory reports. As far as loading the data, I've got seed files if that's something that'll help - I had always gotten the idea you were more straight PHP than framework, but I'd be happy to copy and paste if it'll help.
  2. Hi y'all. - I've been beating my forehead against this for a few hours now and though I'm sure it's something incredibly obvious and simple, I'm just not seeing the error. This is a historical inventory query - the data is as follows: product_inventory product_locations locations products OK - so that's my data setup. My query is this: SELECT p.productName ,p.productCode ,pi.current_inventory ,pi.transaction_date ,l.name FROM products p LEFT JOIN product_locations pl ON p.productCode = pl.product_id LEFT JOIN ( SELECT product_location_id ,transaction_date ,current_inventory FROM product_inventory WHERE transaction_date < '2020-01-03 23:59:59' ORDER BY transaction_date DESC LIMIT 0, 1 ) pi ON pl.id = pi.product_location_id LEFT JOIN locations l ON pl.location_id = l.id WHERE l.id = 1; And this is my result: Note that I'm not getting a value for either current_inventory or transaction_date for product S10_1949, despite there being 3 matched rows in product_inventory. Can somebody kick me in the head to knock the dust loose and help me figure this out?
  3. Set up a listener in a JavaScript file that's included in the HTML page. How this happens depends on what JavaScript framework or library you're using - if any, because that's different, too - but basically you want to set up a general onclick() listener for your element(s); give each clickable element (the <li> elements in your case) a unique selection attribute so you know specifically which one has been clicked. You can give them all different id attributes or use data-* attributes - whatever is easiest for you works, however I recommend being consistent so as to avoid confusion in the future.
  4. There's gotta be more info here - the log you shared doesn't indicate any kind of problem, and the image looks like a file is uploading. Post any error messages you're getting in the browser or the developer's tools (make sure you check the network tab).
  5. No, using CSS will definitely be better at accomplishing it. You're talking about responsive web design, which is not accomplished with PHP. Stop trying to use a bazooka to kill a gnat.
  6. There's no context around the code you've posted, but there appear to be a couple issues. First and foremost, you're using get_currentuserinfo() , which is deprecated in favor of wp_get_current_user(). Even beyond that, you're requesting the data of the currently logged in user, which is you. So actually your code is doing exactly what you've asked it to do. Another issue is that you're calling get_currentuserinfo() multiple times - if all this code is in the same template you don't need to do that. Give some context to what you're trying to do with this code. If you're in the WordPress loop, use the information about the current post.
  7. Thanks for the verification - it didn't make much sense that you would be able to hint on them given the way they're used, but I don't have a ton of experience with traits...
  8. I could be wrong, but I believe you can't type hint to a trait where obviously you can to a parent class. So depending on how you've got things set up and what exactly you're trying to do, that could be a consideration.
  9. If you're attempting to append data to the text file, you need to open the stream with 'a' or 'a+' mode - 'w' will truncate the file.
  10. Well, you could try your idea about checking to see if $_SESSION is set, or you could read the manual page I linked to and use session_status(). I personally like a front-loader style pattern, so when I'm not using a CMS or framework (which will usually handle sessions for you by doing exactly this) I typically turn on sessions in the initial loader file then forget about it.
  11. If you start all your php scripts with that, then you're attempting to start an already started session every time you use an include or require directive. Depending on the pattern you're using it may or may not be easy to make sure you only instantiate the session once, but you can always check to see if a session has been started before attempting to start another one.
  12. This issue is that the php files have functions that throw an error if there's any output before those functions are run, right? Wouldn't then the solution be to put any output after those functions are run? *Hint* The CSS link in your HTML is output.
  13. Actually that's exactly what we're doing right now - we open GitKraken and try to follow the graph. Don't get me wrong - it works, I just personally find it a bit frustrating. It's probably a moot point as we're looking into moving to a scrum process in the new year; so theoretically we should know at all times what's being worked on for the next release. However, I have to assume that scrum doesn't always work as advertised, and I can see the possibility of losing track if we have a single release that spans multiple scrums. Looking at it further though, I guess it's possible that creating pull requests from the feature branch(es) into master, then creating another pull request from master into production could give me the trail I'm looking for. At least I can see in GitLab the branches that were merged into master after the last merge from master into production... Just kinda wish there was an audit view on a branch to easily show any branches that have been merged into the current one.
  14. Kinda what I figured - thanks for the link!
  15. Hey y'all. I know this isn't the right forum for this but didn't see a better spot so mods, please feel free to move this. I've not really had to deal with merge/pull requests all that much in the past, but I've now started in a position where I sometimes have to check what branches have been merged into another specific (in this case, RC) branch. I'm not really finding anything in my searches that leads me to believe it's possible - `git log {branch} --merges` doesn't really show what I'm looking for, nor does `git branch --list -a --merged`, and GitLab isn't terribly helpful so far as I can see. Am I missing something here? Is there a way to see it in git, or has anybody found another way to see merged branches by overall merges that I'm overlooking? And I don't think simply searching for the release tag will work in this situation as we merge into the tagged RC branch manually right now so I can't just look for `rc_{whatever}` tags on all branches - that tag is only on the RC branch, and looking through twelve million individual commits doesn't seem like a ton of fun.
  16. What exactly do you need? You said you fixed it...
  17. Or use AJAX. Depends on what you're trying to accomplish and how you're trying to accomplish it. As far as the security goes, no matter what you do that part's going to be up to you, and I'd recommend not just blindly copy/pasting code from the internet in this situation.
  18. Which file(s)? The only issues I've really run into with PHPMailer involved incorrect email addresses and authentication issues, so I'd be interested to know. Also, make sure there's been an issue submitted to the repo if there's an error in the code.
  19. If it's set up in the image you could use exif_read_data() to grab comment metadata and output that as the caption.
  20. I totally get that, but there's really not a more elegant way to handle this situation that I can think of off the top of my head - maybe someone else can pop in with a suggestion.
  21. In the second code block, you're only running the readdir() once, so as long as it's not false on the initial run, it never will be.
  22. I can't see where $ranges is defined, so once you define $two_letter_country_code you may have another undefined variable error unless it's defined in "ip_files/".$numbers[0].".php".
  23. https://hub.docker.com/r/phpdockerio/php72-fpm Use that one?
  24. When I asked you to post the code, I meant for you to post the code that's actually being run. You mention a 'first' script that you don't show us, and then talk about what doesn't happen when you "combine" that script with what you do show. How are you combining the scripts? What does the resulting script look like? Right now you're asking us to tell you why your shower isn't working by telling us you have a bathroom.
  25. Sorry - bit confused here. Are you saying that if you've already submitted the form and then you run JavaScript replaceState it doesn't resubmit your data? I'm sure someone will correct me if I'm mistaken, but I believe that replaceState() won't actually redirect or refresh your browser - it just tells the browser history object where it thinks it's been or where it thinks it currently is. If you're trying to actually reload the current page, maybe window.location.reload()?
×
×
  • 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.