Jump to content

whats the point of mysqli_select_db


ala888

Recommended Posts

whats the point of mysqli_select_db if I can just refine my queries via schemas ?

 

Instead of saying mysqli_select_db('somedb','someconnection');

//do my query stuff.

 

cant I just do ?

//do my query stuff on `somedb`.`sometable`

 

?

Link to comment
Share on other sites

I believe that a connection to MySQL requires a specific database. It's still possible to do queries across multiple databases if your user account has access, but connecting requires a specific database (and a user with access to that database).

Link to comment
Share on other sites

I believe so. I run queries across multiple databases in phpMyAdmin, which obviously is written in PHP. I assume they use mysqli to do that. That's the only experience I have doing that though, I haven't written any applications that try to use multiple databases.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...