-
Posts
15,288 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
Incorrect datetime value: '2022-01-24T20:52:00.000Z' for function str_to_date
requinix replied to AJM2's topic in MySQL Help
Look at the query. STR_TO_DATE('2022-01-24T20:52:00.000Z' , '%c-%e-%Y %T') What will that try to do? -
Programming is not like cooking, where you can throw a bunch of things into a pot and get a delicious gumbo. Programming is like painting: the canvas may vary and what you're trying to draw will be different each day, but you need to work with the paints in a certain way, and if you try to throw them together then all you're going to be able to paint is "Brown Rock In Puddle of Mud". If you want red then you use red, and if you want yellow then you use yellow, and if you want some shade of orange then you mix red and yellow together in very precise, calculated, and controlled proportions. You've got a lot of things going on here and only a small fraction of them are going to be appropriate, let alone useful, to your end goal. It's complicated enough that I'm not even entirely sure what your end goal is supposed to be (other than "you want a red dot"). So let's start at the beginning - or perhaps a little bit on this side of it. You have a database, but let's pretend you already got what you need from it and now have that $b64 variable. In as technical terms as you know, what do you need to do with it? Do you need to output an <img> into your HTML that will show this image? Or do you already have the <img> and you need a script that you can reference to show the image? And I'll skip ahead a bit and ask: in the general case, are these images going to be small and simple, or potentially large and detailed? Judging by the fact that you're talking about JPEGs that are 5"x5", I'm thinking the latter. We'll come back to that later.
-
Spend some time learning about PHP so that you can understand what sort of changes you will be making. // this variable is defined outside of foo() $outside = 123; function foo() { // you cannot use $outside here echo $outside; // warning: undefined variable } foo(); // if you want to use a variable inside a function then you must pass it as a function argument function bar($inside) { // you can use $inside here and it will have the same value as $outside echo $inside; // 123 } bar($outside);
-
Server always change SQL mode to be ONLY_FULL_GROUP_BY
requinix replied to nitiphone2021's topic in MySQL Help
Fix your queries so that you don't try to include columns in the SELECT if you aren't GROUPing BY them. SELECT a, b FROM foo GROUP BY a /* bad because "b" is not being grouped by */ How you fix a query depends on what it needs to do... -
Sure: make sure the value stored is a time in the future instead of the current time, then modify the things that query the table for what to show so that they ignore things in the future. Exactly how you do that is going to depend a lot on how the blog is written...
-
I use mostly PHP Debug and PHP Intelephense.
-
Case of deprecated warning with PHP 8.1 and APCUIterator
requinix replied to NotionCommotion's topic in PHP Coding Help
That would be a PHP source code file and line number, but the error happened on APCUIterator::current which is internal code so there is no file or line number. But errors do need to report some location, thus that. -
Don't hijack threads. What code have you tried so far, what has it done, and what did you expect it to do?
-
Session information sharing on different subdomains
requinix replied to Emsanator's topic in PHP Coding Help
There's no "tapping into" or "breaking into" here. If the code running on both subdomains can access the same source of session data (probably files) then they can share the same sessions. This sort of setup happens all the time. If the sessions are files then it's easier to have the sites on the same server - naturally. If the sites weren't, or were "in the cloud" or otherwise distributed, then a database would be better/easier. -
Have you checked php-fpm's own error logs?
-
Case of deprecated warning with PHP 8.1 and APCUIterator
requinix replied to NotionCommotion's topic in PHP Coding Help
APCUIterator is part of the apcu PECL extension. According to the changelog, you need to have version 5.1.21+ for PHP 8.1 support. -
Session information sharing on different subdomains
requinix replied to Emsanator's topic in PHP Coding Help
If you're sure that the user can browse the other site perfectly fine, with the same session information as the first site, then the problem will be somewhere in the code that gets the member ID and stores it in the database... -
What you originally described doesn't seem to match up with what you've posted. I can't tell what is supposed to be what. Can you throw an example into a fiddle? To the question, fixed positioning is the basic answer. Sticky could work too. They both require some setup but either one should do what you want.
-
Session information sharing on different subdomains
requinix replied to Emsanator's topic in PHP Coding Help
You talk about a member ID not being "registered" and post some code that deals with session cookies. I have no idea if the two things are supposed to be related. When the page on the second subdomain handles the form data, either it can access the session data or it cannot. If it can't then you have cookie and/or session data problems, and if it can then you have some problem getting the ID into the database (I guess?). It's hard to tell without knowing your application(s) and having a more detailed explanation of what you're seeing and what you expected to see. -
There are more efficient methods than creating a massive regular expression. For instance, 1. Have the text file be sorted by domain 2. Get the domain from each email address 3. Do a binary search inside the file for the domain
-
It is all PHP code, though. You could go through their code looking for the place where it sends a request through Guzzle, then insert a bit of code to log it or something.
-
I don't know. Can you get the SDK to show you exactly what request it's sending? Maybe it's doing something unexpected. I already complained about the lack of documentation, right?
-
Now that you've fixed the $operationsObject stuff, what does the code look like?
-
Nearly every adult site nowadays includes technical information in the response headers or the HTML source that identifies it as such. Research what I'm talking about and detect that, and rather than try to block them entirely, all you have to do is not publish results for those sites publicly.
-
And what line is 141? Is it the one where you try to echo $response? You can't just output objects like that. Try print_r. But you've got a pretty big bug here: when you create $operationsObject, $operations is an empty array. You add to $operations later but that's too late because $operationsObject has already been created. Move that line until after the array is ready to be used.