Cross Join Query

Does Yii2 have any logic to handle mysql cross joins? If not, is there a clever way it can be done with queryBuilder?

What did you do or achieve so far (except asking and wishing someone else do the hard work for you)?

What did you search, what is your own effort so far (show me your code)?

What causes you to think that Yii DON’T HAVE such logic?

It took me SEVEN SECONDS to put yii 2 cross join query into Google and find this:

And this:

Ultimately this:

Seven seconds, to get an answer to your question. Yes, it has a logic to handle MySQL cross-joins. Yes, it can be done with queryBuilder? Yes, you have hundreds of examples out there.

SEVEN seconds! Finding an answer to your question took me less time then it took you to write it.

A very bad attitude here, in this forum and probably in many more places. Nobody likes “do it for me” people. Don’t expect to get answers here (or anywhere else), if you show ZERO own effort and expect others to do your work for you, sorry.

Dude, did you wake up with a chip on your shoulder this morning or something?

This question is nearly two years old and it went unanswered. I solved this problem long time ago. I don’t even remember exactly what I was doing :rofl::rofl:. I was still new to yii and php at the time :man_shrugging:t5:

I hope resurrecting this old thread and taking the time to write your reply was worth it! You really added something positive to the community!


You have asked a question showing zero own research which is very bad in most forums.

You have solved your problem and did not share your solution with the community. Even worse. Cleary we can see that you threat this forum like your own, personal help-guide, not as a sharing knowledge entity.

Having attitude like that, I am totally not surprised that you questions are left without answers.

Yes, I think I did something positive to the community. I showed up that we don’t like “do-it-for-me” questions here, that shows zero own research done by the person, who asks.

The fact that you asked this question two years ago changes nothing in this case. The fact that you asked without first looking plus the fact that you found your answer elsewhere and did not share with others are the most important.

Dude, seriously?!

Go look at my other threads; there were times I’ve updated wikis with things I’ve found. Like I said, I made this when I was first starting out and I genuinely don’t remember what the issue was. You know why? Because it was nearly two freaking years ago!! I do know that I DID look and did not find exactly what I was looking for. Maybe I was frustrated and just made something quick, I don’t know… because it was two years ago. :roll_eyes:

But honestly, all of that is besides the bigger issue here.

Ok, I didn’t show what I had tried or reply with a solution. Congratulations, I’ll concede to your point!

With that said, you could have approached this from a place of compassion and patience, but instead, you resurrect a 2 year old thread combatively. You could have been friendly and said something along the lines of, “hey, not sure if you found the solution, but in the future, it would be really helpful to do…”

There will ALWAYS be beginners and there will always be someone who doesn’t know the proper way to do things. Instead of creating a space for beginners to speak up and feel encouraged, you’ve shown how hostile a**holes such as yourself will resurrect a 2 year old thread in a combative manner just to make a point.

Your point is 100% valid but you don’t have to be a**hole about it.