Hello,
I want to switch from mysql to mysqli. but i have some questions.
Are there an advantage to use object oriented style:$mysqli=new mysqli(...) or procedural style : $link=mysqli_connect(.....) ?
My actual website, use mysql and all are procedural style : mysql_connect, mysql_query, mysql_num_rows..........
after doing a query, i close the connection mysql_close($link)... and reopen it if i have another query, such as in a function or further in the same script.... so it means that i can open and close the connection a lot in a same script......
I read that i can create an object like ::$mysqli=new mysqli(...) and nerver close it, and if i call a function, i just send $mysqli to the function: callThisFunction($mysqli) and the connection will be automaticly close when the script finish
Is that better to open,close,open,close........ and so??? or open once and never close it
I want to use the best way for the persomance of entire website!
Thanks for your help!!