Jump to content

requinix

Administrators
  • Posts

    15,274
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. Actually I was hoping for the HTML markup. Not how your browser is displaying it to you. Do a View Source.
  2. You're parsing HTML as text. Don't do that. What's the actual HTML markup for the stuff you're reading?
  3. Too magical. For each page where you care about this, call a function with an identifier for the page. I don't mean "home.php" or "admins.php". I mean like "home" or "admin" or whatever label you want. The function grabs the rank from the session and looks it up in the database. With a query. And reacts accordingly.
  4. Make the redirect happen in your PHP.
  5. I don't see where MySlider is defined. What's your complete code now?
  6. If you don't care about other records once there's a status_id of 3 then why does the department matter?
  7. So I guess what you're saying is that the dept_code is irrelevant?
  8. No. Only the pd+chk pair check for the dept_code. But you are not looking at the pd+chk data. You are looking at the pd+ps data. Put the WHERE back in and make the chk join a LEFT JOIN.
  9. Look at the condition again. Are you using the right columns for everything?
  10. Why are you preloading two different URLs? That don't match what you're using for the IFRAME?
  11. 1. Look at the second JOIN. Does the condition have anything to do with the table it's trying to pull in? 2. You cannot compare anything to NULL. The result will always be NULL. That's how it works. If you want to know whether something is null then you should be using IS NULL.
  12. 1. The second JOIN looks just like the first one, has all the same conditions, plus it looks for dept_core and status_id. The whole point is to find "matching" (whatever that means to you) production_status that also meet your exclusion criteria. 2. Forget the WHERE NOT EXISTS. Get rid of it. Instead you need a WHERE to make sure that the second production_status, which you should give an alias, did not match - the easiest method for that being to test that a non-nullable column was null.
  13. Do your query like you would normally do if it didn't have that condition. I don't know if you want that JOIN to be LEFT or not. Then add another LEFT JOIN to production_status like you'll already have, except it has the additional conditions for the dept_code and status_id. So the join will attempt to find matching records in the table. Then add a WHERE so that you only include rows when the second JOIN didn't find anything.
  14. Are you trying to exclude rows from production_data that have any 13/3 rows in production_status? Or just not include the 13/3 rows in the results?
  15. Fails with what message? What "doesn't work" and exactly what does "breaks CSS" mean?
  16. Depending on your terminal, yes.
  17. You said you took the FL if statement out. You did not post that version. But it's not as important as posting the code that is calling this function.
  18. Post your modified function as well, as the code calling the function and any other code that could possibly be relevant to your problem.
  19. What about states other than Florida?
  20. Variables defined outside of functions are not available inside of functions. You need to use function arguments to get values in, then return whatever single value you want out of it.
  21. array_merge will renumber arrays if they have numeric keys. Are your product_codes numeric? Honestly, all that code is far more complicated than it needs to be. You're checking if the product_code exists in the cart so you can update its quantity, and then you run a loop over everything in the cart? And when you want to add the (new) item to the cart, you use array_merge instead of just adding the item directly to the cart array? Try spending some time thinking about what's happening in there and whether there's any way you can reduce the number of lines to, say, half of what's there now.
  22. Precedence is like automatic grouping with parentheses. You know how multiplication has higher precedence than addition? That's why 1 + 2 * 3 is 7 and not 9: because it's like 1 + (2 * 3). Since ?? has higher precedence, the statement seems like it should do return ($cache[$class] ?? $cache[$class]) = new $class;
  23. Oh. About shortening code, it can go one step further: static $cache = []; return $cache[$class] ?? $cache[$class] = new $class; If you want to have a good time, figure out how that works. If you want to have a really good time, figure out how that works given that ?? has higher precedence than =
  24. +1 to $cache. Because that's what it is.
×
×
  • 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.