Can php query the results from a previous query?

前端 未结 5 844
梦如初夏
梦如初夏 2021-02-09 03:05

In some languages (ColdFusion comes to mind), you can run a query on the result set from a previous query. Is it possible to do something like that in php (with MySQL as the dat

5条回答
  •  失恋的感觉
    2021-02-09 03:23

    There is no MySQL function like this for PHP, however there is a more advanced substitute for it.

    Edit: For those of you who don't know what a query of queries is, it's exactly this and there's a purpose some people do it like this. Using an AND operator is ****NOT**** the same thing! If I want results where username='animuson' for one part of my script and then want all the results out of that query where status='1', it is not logical for me to run another query using an AND operator, it is much more logical to loop through the previous results in PHP. Stop upvoting things without reading the comments on why they weren't upvoted in the first place, that's just lazy. If you don't have a clue what's being talked about, you shouldn't be upvoting or downvoting in the first place.

提交回复
热议问题