1

I'm starting to transition towards Mysqli on my website project and am noticing that for several different functions such as mysqli_query or mysqli_select_db it is requiring the first parameter to be $link, $link being mysqli_connect().

Is this necessary for every function? If I leave out the parameter can I expect the function to go to the default mysqli_connect() I put at the beginning of my code?

4

1 回答 1

1

It is only required if you use the procedural interface.

If you are using the object oriented interface it isn't necessary because all of your calls use the $mysqli object to call functions.

See Dual procedural and object-oriented interface for more explanation.

于 2012-07-21T21:43:52.067 回答