-
Posts
15,280 -
Joined
-
Last visited
-
Days Won
432
Everything posted by requinix
-
if ($statu1 = "Online") { echo "<font color = green>$status1->nodeValue</font><br>"; } elseif ($statu1 = "Offline") { echo "<font color = red>$status1->nodeValue</font><br>"; } One = does an assignment, which means the above code actually works like $statu1 = "Online"; if ($statu1) { echo "<font color = green>$status1->nodeValue</font><br>"; So naturally, every status will be green. Two ==s does equality comparison. (Three ===s is if you want to be pedantic about what it means to be "equal".) if ($statu1 == "Online") { echo "<font color = green>$status1->nodeValue</font><br>"; } elseif ($statu1 == "Offline") { echo "<font color = red>$status1->nodeValue</font><br>"; } That aside, this is very outdated HTML 4-style markup. You should switch to <span>s and CSS.
-
php segmentation fault when connecting to Access database
requinix replied to raphael75's topic in PHP Coding Help
Not having symbols is okay, it just means that gdb won't be able to fully translate the machine symbols it's reading into more useful, human-friendly symbols - like, parts of a backtrace will be cryptic. But it'll all still work fine. -
I was following along until the "please do this for me" bit at the end. REGEXREPLACE + REGEXEXTRACT like that is silly. Not sure where you got it from, but a single REGEXEXTRACT is enough to extract all the <uppercase letter + stuff>s in the cell. Check the documentation/help docs for how to make it match everything instead of just once (which is what it does by default). For the regex part, it's currently doing <uppercase letter + lowercase letters> so naturally it will only work with lowercase letters and not with numbers or symbols. If you want to match things that look like <uppercase letter + stuff> then realize that "stuff" is a less precise way of saying "keep going until the next uppercase letter". Or in other words, "anything that isn't uppercase". Because computers need you to be precise if you want them to work a certain way. Excel's regex syntax for "anything that isn't ___" is the same as everybody else does it, so you can check either the docs (which I'm sure include a little bit of regular expression syntax) or virtually any other regex resource to find how to write that.
-
Perhaps a GROUP BY issue going from MySQL 7.# to 8.#...
requinix replied to Jim R's topic in MySQL Help
It worked for years even though it's clearly missing a comma at the end of the first line? -
php segmentation fault when connecting to Access database
requinix replied to raphael75's topic in PHP Coding Help
Did you run gdb the same way as you had before? Did you get the same output (before the bt step) as before, including the part where it says there was a segmentation fault? -
php segmentation fault when connecting to Access database
requinix replied to raphael75's topic in PHP Coding Help
I'm pretty sure you're encountering https://github.com/mdbtools/mdbtools/issues/312. Good news is that it was fixed, bad news is that it was fixed in mdbtools 1.0.1 and Ubuntu 24.04 currently only covers through 1.0.0. There might be a third-party PPA out there that has an updated version, but I don't know where to look for one. Or you could venture down the path of building it yourself, if you wanted: grab the Ubuntu sources, patch them according to this PR, and build. Or for a workaround, I think you'll be safe as long as you're not SELECTing anything that requires 64-bits of data length - meaning a VARCHAR(16777215) is okay but a VARCHAR(16777216) is not. -
query using odbc on access db error: Couldn't parse SQL
requinix replied to raphael75's topic in PHP Coding Help
I did. I can never remember which systems allow for quoting identifiers with apostrophes or quotation marks. -
query using odbc on access db error: Couldn't parse SQL
requinix replied to raphael75's topic in PHP Coding Help
I don't think backticks are the right quoting style, but brackets should have been. Or maybe not. Try single and double quotes too. Been a while but I think the LIMIT could be a problem too. Does SELECT TOP 3... instead work? -
php segmentation fault when connecting to Access database
requinix replied to raphael75's topic in PHP Coding Help
That insane number for how much memory it tried to allocate strongly indicates an internal problem. But with both pdo_odbc and the plain odbc extension? Now I'm suspecting MDBTools is the one at fault. Are you using the latest version of that? Can you identify exactly which column(s) is causing the problem? What data type is it? Are you able to run SELECT queries on other tables that have a column of the same type? -
php segmentation fault when connecting to Access database
requinix replied to raphael75's topic in PHP Coding Help
Looks good. I think you might be running into a bug related to this one, which seems like it was fixed in the v2.3.12 you're using so it's probably not that exactly. One way or another, the problem does seem to be about connection pooling. Pooling won't gain you anything on the CLI so try disabling it. -
php segmentation fault when connecting to Access database
requinix replied to raphael75's topic in PHP Coding Help
Almost there. Do that, then when you get the gdb prompt enter "bt" and it will dump a bunch of numbered lines. So far, though, it looks like the problem is in unixODBC, which is surprising as you're already on the current version - that said, it's been a couple years so I'm not sure it's still maintained... -
php segmentation fault when connecting to Access database
requinix replied to raphael75's topic in PHP Coding Help
Can you post a backtrace from gdb? -
Download a dynamically made file as part of ajax
requinix replied to M.O.S. Studios's topic in PHP Coding Help
Why use AJAX at all? Simply send the browser to the "page" which (immediately) serves the download. -
If you'd like to ask a bot to tell you how to make that traffic generator, I'VE GOT GOOD NEWS FOR YOU!
-
how to make a fake traffic generator BOT in php?
requinix replied to zatat1's topic in PHP Coding Help
No thanks. -
Delete Problems List in VSC
requinix replied to LeonLatex's topic in Editor Help (PhpStorm, VS Code, etc)
You're reinstalling VS Code for this? Either the error isn't fixed like you think, or the thing presenting the error is running from a cached version that somehow hasn't updated. Reloading the window, let alone quitting and restarting, should resolve the latter. Maybe some more specific information would be helpful? -
Services Offered has been a place for people to offer their services for hire. Over time, it's "evolved" to support companies to announce themselves as well (provided their services are on-topic), and today it primarily functions as a pseudo-sanctioned forum for spam. There's a slight moderation burden in monitoring it for off-topic spam and removing replies (which are against rules but the forum software isn't able to enforce this adequately). Job Offerings has been the other side of the coin, where people and companies could post about jobs they have available. It doesn't see much activity these days - 5 threads in the last two years. Given that Services Offered is more of a burden than a benefit and that Job Offerings isn't much of an offering anymore, we're looking to close them down within the next week or so. Thoughts?
-
Delete Problems List in VSC
requinix replied to LeonLatex's topic in Editor Help (PhpStorm, VS Code, etc)
The "Problems" tab is a list of problems detected by the IDE and/or various extensions. You clear the list by fixing the problems, or somehow otherwise turning off the error reporting. You can hide the tab entirely through the right-click menu on the tab area, and similarly for the problems list in the status bar. -
Something doesn't make sense here. Why can you look at IV values in the "current" element but for the pills/syrup you have to look "ahead"? I'm also not really following the algorithm. Given the example there, exactly what steps are you (as a human) following to get exactly what output?
-
This post implies using their UsesServiceTrait to handle the mocking (well, faking of results) as seen in places like S3's MultipartUploaderTest.
-
Don't? Just give it the whole document you're working with. When you did what, it did what with your what? It will make some alterations if necessary to make the document valid, which means if it's doing something then that likely means the source was somewhat incorrect HTML. Spend a bit of time getting familiar with DOM as a whole (not PHP's implementation, I mean the concept itself) and what it can do. With the sample you posted, I would expect an implementation that (1) finds H2 elements, (2) grabs their nextSiblings for the first paragraph, and (3) grabs their nextSiblings for the second paragraphs. It's also possible to do XPath queries for more advanced searching, but the new DOM API offers querySelector/querySelectorAll which is nearly as powerful. 🌎🧑🚀🔫🧑🚀 Always have been.
-
You cannot run Javascript code inside your PHP code. It does not work and never will work. The only reason you saw "3072" before was because your PHP literally outputted that <script>, the Javascript executed in your browser, and what the code does is literally write the value to the page. The only way to get values like screen.width to PHP is through some sort of request to the server, such as AJAX. If that's not working for you then fix that and then you'll be able to use AJAX just like everyone else. But that's probably the wrong thing. Why does your PHP need to know the screen width?