I wasn't freeing my statements, as I didn't think it was necessary per se, as the manual says "mysql_free_result() only needs to be called if you are concerned about how much memory is being used for queries that return large result sets." so I didn't. But then I got an error saying: "Commands out of sync; you can't run this command now" which only went away when I freed my results. Weird.
So is it necessary?
Also, what's the difference between close()
and free_result()
? In PHP's manual they have close used to close statements (in one of the examples on this fetch manual). But they also use free_result
here and it's unclear the difference.