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
-
There is always a better way: to avoid what you say you want in the first place. What's the goal in it, by the way? If it's SQL and you intend to combine values from related tables, there is (LEFT) JOIN.
-
@Afrographics learn SQL once, one language to query them all, in perspective less overhead. The less garbage you query, the better implications are 🙂
-
C0D4668944yWhere's your query(s), this feels like it's queried incorrectly and then attempted to be mashed back together.
-
Hazarth95444y3 for-eaches in a single function are a bit of a red-flag to me
You should be able to just query and join the data on SQL side and then a single cycle should be enough
This feels like you did 3 queries for 3 tables and then tried to join them in code by going over all of them...
That's probably what that first IF does...
That's gonna be messy and slow as hell on bigger tables because it grows exponentially...
Related Rants
i want to make an object from data from multiple related tables in my database,
do you know a better way?
random
mysql
php