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
-
C0D4669027yHard coded credentials 😱
Not in a function / class 😳
Root access 😡😡😡😡😡😡😡😡 -
@C0D4 I'm still learning... I know the importance of all these... It's still on local host so don't worry about root access
-
C0D4669027y@dextel2
Ok starting out, I can be more lenient.
Put the credentials into a config / definitions file.
So you can reuse them.
Shove the mysqli connector into a class or atleast a function you can reuse.
Plenty of mysqli wrappers out there in the wild, not all great.
And as it’s local I can accept root, but if that ever moves make a new user with restricted permissions.
Also use fetch_assoc not array. It will make your life a billion times easier to debug things later.
Related Rants
Just before deploying this to prod found this bug... discover this bug with bunch of print statements
random
bugs
php
prod