Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lotd79227yWhy the raw sql strings..
Only case I've come across it being worthwhile with it, was In performance critical environments..
But in those environments, php isn't really a considerable option.. *cough* threading..
Maybe in 7.2 with pthreads. -
myss45287y@PrivateGER
First day or two it wasn't noticable because nobody updated their profile.
When one person did it the avalanche effect started and everyone was updating their infos cause they were obviously wrong..
After geting a report of a problem, he spents two days checking and dumping the output cause he thought he's somehow retrieving or printing wrong data (from another user).
He then decided to take a look at the production database and found out what's happening.
Then it took him whole day of digging through his code to find the problem while casually replacing his typos, indentations, whitespaces, blanks lines etc. Pretty sure he made this on purpose so if anybody goes to his commit in future, they don't spot the fuckup so easily.
Than the weekend came and in Monday he asks me to deploy the changes manually via webhook and pull out RDS snapshot from Amazon saying the problem is finally fixed.
And what's the funiest of all his commit message on git was "minor fixes".. -
@myss
There seems to be a framework. Probably yii2
I would use raw SQL with it only if there are any complex queries due to performance. Other than that , framework is just fine -
I'm not used to raw queries in PHP at all, but I can't see the problem here.
The "where" condition is given, the binding was made the same way for others params...
So, what am I missing? :/ -
@myss since everybody thought it was better to downvote my question rather than giving an answer, can you please explain me what is wrong here?
-
myss45287y@LurkingAround Take a look at the image again. The problem was in the first, red line. This was replaced by green lines later. It's just a screenshot from diff comparison between two git commits..
-
@myss I didn't understand your comment the right way. I understood your colleague fixed a previous bug (the red one), committing a new one.
I was looking for the error in the green one. Now I get it ^^
Thanks for taking your time and giving an answer, despite the one's who just simply downvoted.
And then they have the guts to say that SO user's are assholes..... :/
Related Rants
Ex-coworker of mine fixed this bug a week after the site was launched and has gathered several thousand users in database.
Yep its exactly what you think it is, each time one user would update its infos, it would update his infos to all the users in the database.
Luckily I was not in charge of the project in that time, so it was really fun to watch how everyone's name was changing every couple of minutes for a whole week :D
undefined
api
pdo
php
sql
production