tags:

views:

157

answers:

1

Hello all. I am new to mysql and php, but am attempting to make my own cms to help make managing my websites easier. Can someone explain the mysqli's close() function. 1)Is it nesseccary? 2)What exactly does it do? 3)I heard that after php runs its script that it closes the connection, is that true? 4)Lastly, is there a security issue when not closing your connection to the database? Thanks

+4  A: 
1)Is it nesseccary?

No, PHP will end your connection after it finishes running.

2)What exactly does it do?

The reverse of mysqli_connect() -- it closes the active DB connection.

3)I heard that after php runs its script that it closes the connection, is that true? 

Yes, see (1).

4)Lastly, is there a security issue when not closing your connection to the database?

Nope, no security issue. The connection can't be hijacked by an outsider or anything like that.

Coronatus
Thanks for the quick reply.
Theopile