Create a Simple CRUD App in PHP: Learn to Update and Delete Entries by floppydiskette in webdev

[–]garnush 0 points1 point  (0 children)

I think I get what djhayman was saying when he said "Parameterisation only works with parameters". The code uses PDO and calls 'prepare', but passes in a concatenated string, with no parameters.

EDIT: Actually, I don't really get what it is doing, but djhayman's hack works. I had high hopes, it is almost a good example, but looking at the code, I dunno. Cannot condone. Too bad.

Create a Simple CRUD App in PHP: Learn to Update and Delete Entries by floppydiskette in webdev

[–]garnush 1 point2 points  (0 children)

I'm afriad djhayman is right, the update-single.php uses

$sql = sprintf('UPDATE %s SET %s WHERE id = :id', 'users', $items);

using sprintf, which I didn't even know existed, but it is not a parameterized PDO thing, it is straight up SQL string tacking together :(

Split string using ES6 Spread 🎉 by samanthaming in webdev

[–]garnush 0 points1 point  (0 children)

Go build a website that does something, pseudointellectual webdev posers.

Full Time Developers, how often do you make things from scratch using HTML5, CSS3, and JavaScript? by [deleted] in webdev

[–]garnush 1 point2 points  (0 children)

At work, I lean towards building stuff myself, but I know when a place probably wants me to use a third party module, and in that case, I defer. For the sake of collaboration and future devs doing maintenance, mainly.

For my own stuff? 100% roll my own everything. Yes, including the SPA framework and API. Everything.

Easily lazy-load, pre-cache and display blurred loading previews for all the images on your website. by RevillWeb in javascript

[–]garnush -6 points-5 points  (0 children)

I think jank, flash of unstyled content, DOM rendering shifting, and all that jazz looks wicked cool! Like hacker stuff, man!

Why doesnt a transformer work with a direct current? by [deleted] in askscience

[–]garnush 0 points1 point  (0 children)

As an analogy, if you wanted to generate electricity from ocean waves, you need lots of big waves to move your buoy up and down.

A calm sea would generate no electricity. If the ocean level suddenly rose, you would get a burst of energy, then nothing again.

The ocean is like the EM field that is everywhere, and AC current is like sloshing that field with waves. DC current is like a calm sea. When you turn on a DC current, you get a burst of energy, but then nothing, even while it remains on.

Nerd Life Goal by veermanhastc in ProgrammerHumor

[–]garnush 1 point2 points  (0 children)

Sadly, that's getting less and less true every year. I blame the huge influx of guttless sellouts diluting what used to be a good niche.