Mysqli query and close within a foreach loop : <p>Within a foreach loop I have a SQL query insert. This query should run two times because I am looping through my session that contains two elements, keys or whatever you prefer to call it. It works fine and it makes a new query for every new iteration. But when I put in mysqli_close in the code it only makes the first insert, and then on the next iteration it gets an error. Why does it not "reopen" the query on the next iteration when it loops through it again?</p>

<p>I know there are better ways to make "multiple" querys, I was just playing around and noticed this, and then I got curious. Any thoughts?</p>

<p>Take care</p>
