Jump to content

LLLLLLL

Members
  • Posts

    306
  • Joined

  • Last visited

Everything posted by LLLLLLL

  1. In fact, adding the unique constraint does nothing. The trigger STILL adds identical values. Whoa. And now it stopped...? I'm going to do some MySql maintenance or something...
  2. They are identical. (In fact, I can't set the column to unique right now because the values are duplicate.) You created the trigger in the exact same way, and your Uid was different when inserting two rows?
  3. I have a trigger, CREATE TRIGGER `TRIGGER_SOMETABLE_UID` BEFORE INSERT ON `SOMETABLE` FOR EACH ROW SET NEW.Uid = UUID( ) Now, I thought this would fire FOR EACH ROW, but if I'm doing an insert like this... insert into sometable ( col1, col2 ) ( select col1, col2 from SOME_OTHER_tABLE ) ... and that inserts two rows, the result is that Uid in both new rows is identical. This is not the desired behavior. Can you tell me how to get a unique Uid in each row?
  4. preg_match( '/\d{5}-\d{4}/', $input ) My issue was that the - in my original syntax was somehow a ndash... so it was the wrong character. Whoa. Sorry I created this thread.
  5. I suck at Regex. Can someone tell me the PHP regex check to see if a string is 12345-6789 .... meaning, five digits, a dash, and then four digits? I'm sure it's quite simple for a Regex pro. Thank you.
  6. Yes, it seems the goal was to write "clever" code instead of something that just works. It's likely we won't be using them long-term, but for now I'd love to figure out why I can't even reach the /setup folder to do anything. My error is the same that hundreds of others have reported.... as with most freeware carts, there are no solutions to be found on the interwebs. "Free carts aren't free."
  7. The class ends up being Magento\Backend\Model\Auth\Session\Interceptor, which isn't a class that exists. I assume it gets created on the fly? Seriously, there are 48,000 Magento files; the software is more bloat than I've ever seen. I'll look into XDebug, I guess.
  8. I've been given an unfortunate task of working with magento. My question might be magento-specific, but I'm not sure that it is. In short, I'm troubleshooting something and confused. This code... $user = $this->getUser(); ...would seem to be quite easy to troubleshoot, but it is not. The current class has no getUser function. Its base class has no getUser function. If I print a debug statement to examine $this, the class I'm looking at -- Session -- isn't the class at all! $this is some other class! In fact, the class that is shown doesn't exist anywhere in the source code. So... what the heck? How can $this not be $this ??
  9. Yeah, no kidding. I always enjoy a large website saying "letters and numbers only." Seriously??
  10. I agree with these replies but... I guess I wonder why SO MANY websites still say that some characters are unallowed. Mmmph. And I'm talking about major websites like large banks, financial institutions, or other similar corporations
  11. I'm curious to get opinions on using strip_tags() for fields that will be encrypted in a database. I often see websites that say "choose a password that contains X certain characters but not Z other characters." And I got curious. Let's say there's a registration form where a new user creates a username and password, and the server will store the password as ... sha1( $user_entered_value ) ... or some other sort of hashed/encrypted string. In this case, why would it ever matter that a user had entered <div> or some other such text in their password? The password will only ever be hashed into something before it is matched... so why would you bother stripping tags? Why bother preventing any "special" characters? Thoughts?
  12. The only Apache setting I know to allow PHP to apply to HTML is AddHandler application/x-httpd-php5 .html That's already there.
  13. This is not the common "I don't know how to set Apache to handle PHP in an HTML file" type of issue. That works. AddHandler application/x-httpd-php5 .html I don't usually configure things like this, but I'm working with an existing site and I don't really want to make a change to URLs here. (If all else fails I'll just add a rewrite in .htaccess.) Here are two examples of what's happening: I have some files that are PHP, and they include HTML files. The HTML partial files sometimes have PHP code. That code works. If I simply try to access somefile.html, and that file includes only PHP code, the raw PHP code will be displayed, instead of being executed as code. Why would that first bullet point be true if that second one is false? Again, I wouldn't have structured things how they are structured now, if starting from scratch. I'll probably do something a little bit different but I would like to know, as general knowledge, why the current setup would fail. Does it matter that in one example a PHP code is being called first, where as the other example calls a .html file directly (as opposed to being included)?
  14. Yes yes, fine. Why does every PHPFreaks answer have to be some show of chest-thumping? Gosh, I thanked you for your answer. I'm well aware that "the attribute isn't limited to strings and ints", but hey, if you feel better about yourself with your guru-like knowledge-dropping, then congrats. Again, thank you for your initial response.
  15. I'm aware of how strongly typed languages work, and I would write different code. Sometimes weakly-typed languages have advantages. (mp_size has other reasons to be ints) You're saying that ... 0 == (int)"LARGE" ... when I would have thought that "0" != "LARGE" So I guess it's a matter of what gets converted to what, and I was thinking about it the opposite way of what actually occurs. Thanks.
  16. class ufo { const MP_SIZE_LARGE = 600; const MP_SIZE_MEDIUM = 400; const MP_SIZE_SMALL = 250; const LARGE = 'LARGE'; const MEDIUM = 'MEDIUM'; const SMALL = 'SMALL'; public $mp_size; public function desired_width() { switch ( $this->mp_size ) { case ufo::LARGE : return ufo::MP_SIZE_LARGE; case ufo::MEDIUM : return ufo::MP_SIZE_MEDIUM; case ufo::SMALL : return ufo::MP_SIZE_SMALL; default: return 0; } } } So check out the class and function above. What should "desired width" return if mp_size is 0? It makes no sense that the value is anything but 0. Instead, it returns 600. In fact, it will return 400 if I put the "medium" case first. Why would it do that? The function returns expected values if I put strval() around the mp_size. Can someone explain that? This makes absolutely no sense to me. I can't see how the order of the cases could possibly matter, and I also can't see how any case would be "true" when 0 doesn't equal "LARGE".
  17. As I pointed out, browsers don't attempt to do it. Somehow, the browser and the OS decide together. Same version of Chrome does on ChromeOS/Windows, but not Mac. Sorry that I pointed this out and it might have helped someone.
  18. The arrogance on PHP Freaks is why I rarely visit.
  19. But... it is a Mac issue. Chromebook, Chrome on Windows, Firefox, IE, Edge (whatever that nonsense is!) all showed bold without the colon:weight thing. Only Mac did not.
  20. I guess PHPFreaks won't let me edit more than once? Indeed, this is a Mac issue: Chrome, Safari, and Firefox on Mac all had the issue.
  21. A website user was telling me that text wasn't appearing on bold when the CSS called for font-weight:bold. She's using a Mac desktop, with Safari (and possibly Chrome; I don't have all info yet). The font is Raleway: <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css"> From what I was able to find -- no one on Google seemed to have this exact issue -- sometimes Safari won't show bold unless you specifically reference a font for it? Is that right? So the solution seems to be changing the stylesheet reference to: <link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet" type="text/css"> This just seems incredibly odd to me. I've never heard of a user having this issue before. Is this known? Is that the actual fix? Am I to assume all browsers on Chromebook (my preferred platform) and Linux and Windows just create an ad-hoc "faux bold" to display, if bold isn't specified? A lot of questions, but this is just a weird issue, especially since I haven't heard of it until June 2016.
  22. It looks like this isn't a mainstream property: https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside I know how to use Google, thanks. I just didn't use the proper phrases to get me a result.
  23. break-inside: avoid-column; That is quite excellent information. Like I said, I'm new to column-count, so I didn't know little things like this. Quite perfect, thank you!
  24. Check out the (very incomplete new) website at http://mainlypiano.com/artists I'm using column-count of 3 (or 2 based on responsive size). On a normal desktop screen, you can type artist text in the search box, and the filter works just fine. The results stay in the columns and that's just fine. But if the screen is narrower (about 660px, for example) and you search for one of the longer names... - fiona - saen ... you'll see that the ONE entry that is available has its text split over the two columns. I don't want that. I'm also curious why the text of the second column displays higher than the first column text after typing those names. Not sure what I can do to make the text stay in one column. The A element is already a BLOCK style, so why the heck would it wrap into that column? I don't do much with column-count, but I don't know why it would be special. Or especially weird. Ideas? Thank you.
×
×
  • 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.