Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by requinix

  1. How about the entire .htaccess then?
  2. In case it's the answer to this, What's the rewriting rule that handles this whatever page but without the @username bit?
  3. Forget multiple rows for a minute. Can you do it for just one row?
  4. Does the value show properly with something like phpMyAdmin? Is your database connection set up to use UTF-8?
  5. To be clear: the company you are working for needs you to do something, and rather than do it yourself, you're looking for something you can grab off the internet with a minimum amount of effort on your part?
  6. An ellipsis is often used to indicate that some words have been cut off to fit inside a small space. There is almost always some way to find out what the rest of them were.
  7. The code I posted is actually SQL you can run.
  8. Does your sql_mode setting include ANSI or ANSI_QUOTES? SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode;
  9. It's (cough) possible I saw the number 86400, thought "oh I recognize that", and went straight into the DST explanation. Which is wrong for two reasons: that number is for a day not an hour, and because we're dealing with UTC here. But what I was right about was the apparent vs. elapsed issue. Look at the dates - just the dates: 2017-06-26 => 2017-07-09 = 4 days of June + 9 days of July = 13 days 2018-03-05 => 2018-03-18 = 13 days Good 2017-12-08 => 2018-02-15 = 24 days of December + 31 days of January + 15 days of February = 69 days 2018-03-05 => 2018-05-12 = 27 days of March + 30 days of April + 12 days of May = 69 days Good But that's elapsed time and diff deals with apparent time. And apparently, 2017-06-26 => 2017-07-09 = 0 months + 13 days (overflowing after 30) = 13 days 2018-03-05 => 2018-03-18 = 0 months + 13 days = 13 days Same 2017-12-08 => 2018-02-15 = 2 months (December with 31 days, January with 31 days) + 7 days = 69 days 2018-03-05 => 2018-05-12 = 2 months (March with 31 days, April with 30 days) + 7 days = 68 days Oh no The results are even more off when you have to deal with February and its mere 28 days. It's weird, but that's what you get when you try to do date math. And unfortunately there's no simple moral to this story: sometimes a diff-ed DateInterval is appropriate (tends to look nicer across DST boundaries), sometimes a diff-ed timestamp is appropriate (tends to work more like what you'd want), and using the wrong one will screw you up.
  10. If I remember correctly, ->diff measures the apparent difference between dates. Like the difference between 00:00 and 05:00 is apparently five hours. But timestamps are a measure of elapsed time. 00:00 to 05:00 could be five hours, or it could be four or six if it crosses a DST boundary.
  11. Odd. The forum editor shows no description for any of those, so it's not like some backfill process set those automatically. At least not in that way. Anyway, saving with an empty description seems to have fixed them.
  12. The mod_rewrite docs list a number of flags that can be passed to RewriteRule. Like typically you should be using [L]ast to stop further rule processing, but it's not always required. In your case you would want [QSA] - query string append. Because normally if you set your own query string in the replacement URL then mod_rewrite won't carry over any that were in the original source. But if someone puts a ?page= or ?id= in the original URL, as in /story/33?page=1, then that will overwrite the one you're setting through the replacement. So I would avoid [QSA] in general and instead make use of the fact that PHP only cares about the last value: RewriteRule ^(.*?)/(.*?)/?$ view.php?%{QUERY_STRING}&page=$1&id=$2
  13. Well that doesn't sound good. If you want your code to change then you'll have to try something. Why are you going to Google when PHP has perfectly good documentation online? Find out what FRENCH_COLLATION actually means and decide what to do with it. That's nice but it doesn't help you find out what you have to do with your PHP code.
  14. What have you tried? It's not like the code is particularly cryptic...
  15. You're right, it was deprecated in 5.3 and removed in 5.4. OP probably had warnings hidden.
  16. Fixed. I've also noticed that some of the CSS uses hardcoded colors so it doesn't properly fit into the theming system (which allows for overriding them through a UI). I didn't change too many from the defaults so this probably shouldn't be much of an issue, but it may explain some inconsistencies. Or it may end up looking better. Hard to say.
  17. Where? The page background should be a darker blue, the background for forum groups slightly lighter, and the headers even more. Fixed.
  18. Because we're programmers. To switch to it, apparently there isn't a page I can link for you to visit, but there is a Theme selector at the bottom of probably every page. Based on Dark Theme. If you have suggestions about colors to change, reply here.
  19. The official docs. It's not like these are particularly complicated. Go for Serializable and serialize/unserialize. They work with serialized strings, so there's more work than with __sleep's array, but the principle is the same: serialize all the data you need plus the information needed to recreate the connection (and not the connection itself), then you recreate the connection when unserializing.
  20. To add to that, only put variables into (double-quoted) strings if you want a string and it's going to be more than just the contents of that variable. Like writing "$foo" is making it unnecessarily complicated - just $foo is enough. Meanwhile "abc $foo xyz" makes sense because you've got the "abc" and "xyz" bits in there too. unless you want to cast the variable to a string, which "$foo" would do and $foo would not, but if that's the case then you should cast it like (string)$foo instead
  21. You cannot serialize (which is what you need to do) resources like database connections. Which is why methods like __sleep/wakeup and serialize/unserialize exist: for you to customize the behavior before, during, and after the serialization process. So you could serialize the information needed to restore a connection once the object unserializes.
  22. Don't just copy and paste stuff people give you. Understand what the command is actually doing, then you should be in a better shape to know if it needs changes and what they are.
  23. Your code. Not Laravel. Because the problem is going to be with your code, not theirs.
  24. Look at the backtrace to find what part of your code is running. Look for problems there. If you can't find the problem, post the code for the method.
  • 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.