views:

178

answers:

1

Hey Guys, Just wonder if the function mysqli_multi_query connect just 1 time to the database or each query?

+1  A: 

Yes because it uses $link as connection id http://php.net/manual/en/mysqli.multi-query.php

And it doesn't actually connect - it only uses already established connection.

dig
so it's better than mysql_query if I have files with more then 30 queries right?
Yori
It's no different, other than the fact that it's just one line instead of 30 in your PHP. It's still making 30 query requests to the MySQL server. However, this begs the question: Why do you have so many queries? Do you have any that can be JOINed with other queries to make it more efficient?
BraedenP
I build a statistics service for websites that allow websites to put in her website js code and I recive data from their site to me.I think in the feture when someone register with a huge traffic I dont want my mysqld will fall... so I trying to found a results to do it efficient and easly.You have any advice's?
Yori