Jump to content

maxxd

Gurus
  • Posts

    1,655
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by maxxd

  1. mekodak - I'm assuming what you're referring to as 'state' is the value in the 'online' property. So, once you ingest the JSON return and parse the data, loop through the resulting array and print the 'online' index. The third record 'name' value looks weird, but potentially not incorrect.

    morocco-iceberg, use the code button (<>) in the post editor toolbar.

  2. Do you not keep historical data? If not, how do you track and/or display past rounds, settle any disputes over past rounds that may arise, or make decisions about the future architecture based on past demand and performance?

    I may be misunderstanding what you're saying but if I'm not it sounds to me like cutting off your nose to spite your face, hence my comment about the smell.

  3. OK, so places to start researching in order to understand Barand's reply:

    Full disclosure, I've not read the final link fully but from what I've scanned it looks decent. Your data structure looks simple enough right now, just know that as it grows the need for normalization will grow.

  4. Problem is, you're talking about very different ways of getting the data. In the grand scheme of things the problem is as easy as ginerjm says - you get the data and output it while building the response. However, if you're using a CSV you'll need to research fopen() and fgetcsv(). If you're using a JSON string it'll be fopen() and decode_json(). If it's a database, research PDO and MySQL. And if it's an Excel file, that's a whole other can of worms that's going to entail third-party libraries.

    Each potential path has it's own ups and downs; you'll need to decide how you want to store and retrieve the data. Outputting said data is easy - in every case it's a simple echo statement.

    • Like 1
  5. Float's a but quaint these days, but I can't recall off the top of my head any major updates in browser interpretation of it recently. I also don't recall hearing of anything removed from browser parsing of older standards. Sorry for the not terribly useful post, but unless there's some browser-prefixed or experimental definitions or functions I can't think of anything in the past year or so that would break CSS backwards compatibility. Maybe somebody else remembers something?

  6. OK, looking closer you've got more problems than just not using the correct definition. Your HTML is invalid - your h2 elements are I think supposed to be class title2 and aa or bb, but right now that's two separate string so "title2" is ignored entirely. Your CSS is repetitive and nested incorrectly - if you look at the blocks you've marked as making the text glow, they're all wrong. The first block will only target a div or span with a class of 'aa' inside and H1 element, the second will only target a div or span classed 'bb' inside an H2 element, and the third a div or span classed 'cc' inside an H3 element. So none of your markup matches those selectors. Get rid of the H1, H2, and H3 and define .aa, .bb, and .cc. Or, better yet, just define a 'glow' block and use that class on every text block you want to be styled that way.

    The .title1, .title2, and .title3 classes have nothing to do with the effect you're trying to achieve so remove that comment and stop confusing yourself.

    There's also at least one typo in your CSS that your IDE should warn you about.

  7. What's it doing now? Showing us what it should do doesn't really help.

    One thing that I see off the at is that you're not actually calling background-clip; you're doing the webkit- prefix and a moz- prefix (as far as I can find this prefix doesn't actually exist), but never actually calling `background-clip: text`. That may be the issue, but again it's hard to tell without and example of what it's actually doing now.

  8. 1 hour ago, Fastbysuzuki said:

    firstly would updating affect our site?

    I can almost guarantee that yes, yes it will. 5.6 to 7.4 is quite a leap.

    For the other question, I'm not entirely sure what a rota is - let alone what 'addressing from the menu' is - but it's tough for anyone to tell if it'll be affected by upgrading WordPress without knowing what the integration is. If it's a WP plugin (and an old one at that as it runs on 5.6) then yes, it'll probably break.

    Honestly, even as a coalition of volunteers if the site is that important to your organization and the work it's doing, it's going to be worth it to hire a professional to upgrade it for you - a good pro will spin up the site locally and test all the upgrades before they even touch the live site and can more than likely fix any issues they come across. Maybe a GoFundMe drive can help?

    Unless you're in the mood to learn a lot rather quickly. At that point there are plenty of people here ready and willing to help you out when what you tried on your local version of the site explodes for random reasons.

  9. It's not a typo. Steveinid is pretty much correct in the assumption that the query will match either a city or a zip code. If you enter a zip code, the city obviously won't return a result and vice-versa. You're searching the contents of two columns using one criteria and returning anything that matches.

  10. You can use prepared queries for all query types, and if the SQL itself contains any values not hard-coded in the SQL string you absolutely should. That having been said, if you're doing a straight select without external input of any sort, don't bother. It'll just add an (admittedly small) amount of overhead. From your posted code it looks like you're actually doing that already.

    As mac_gyver pointed out, you should be seeing additional PHP errors - I see several missing semicolons in what you posted. I haven't used atom, but it should be pointing out those types of errors for you.

  11. It still seems weird that even having to hard reboot the system would wipe out a file that clearly had been saved. Admittedly, if Windows was already having trouble it has been known to happen; it totally sucks, but yeah - computers barf sometimes.

    As to your second question; no idea, dude. I do however look askance at the `$stmt->close();` line as I'm not sure one really ever needs to close a DB connection in PHP, it handles that pretty well on its own. Somebody here will I hope speak up if I'm mistaken on that.

    What you've posted will overwrite variables of the same name if the code you've posted is nested. For instance, if you're looping through a result set defined as `$result` and you have the code you've posted, then yeah - `$result` will change as of the first iteration of the internal loop (the code you posted) and you'll get unexpected results. I will also say that if you're running a query within a loop based on the result of another query, there's probably a bigger issue with the code. Post what you've got.

×
×
  • 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.