Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

php - mysqli_free_result necessary?

I was looking through my code and read that it was recommened to use mysqli_free_result when your result object is not needed anymore. But after seeing that each query is outputed to the $result variable repeatedly throughout the script, I am wondering if mysqli_free_result would really be necessary. Seems like each time a query is ran the $result variable is already being wiped clean and set to a new result. Just curious if anyone has any input on this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Actually it’s necessary, because it might make a heavy load into the server when many requests are made. So preferably, you should use it.

Some other cases when you know that this query is followed by other query so you don’t have to use it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...