Afficher un message
Vieux 18/10/2007, 12h25   #2
Water Cooler v2
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to know the current database you are in

On Oct 18, 11:24 am, Water Cooler v2 <wtr_...@yahoo.com> wrote:
> Verion: 5.0.45-community-nt
>
> What's the command for knowing the current database you are in. For
> example:
>
> a) mysql> show databases;
>
> outputs:
> 1. foo
> 2. test
> 3. mysql
>
> b) mysql> use foo;
> Database changed
>
> Is there a function or a global variable that will tell me the current
> database I am in?
>
> I KNOW THAT THE 'STATUS' command will, but it also comes up with a lot
> of other stuff. Is there, like, an alternative command that just tells
> you the name of the current database?
>
> Everytime I forget if I am in the right database, I do a 'use foo'
> thing, and it reports 'Database changed' always, even if I am in the
> same database, which I find somewhat irritating and also ignorant on
> my part.
>
> How do I know which database I am sitting inside. I tried looking up
> the manual but couldn't find something like CUR_DB or CURRENT_DB or
> some such thing.





Sorry, feeling stupid about my question. Soon after I hit the 'Send'
button on the original post, I came accross the DATABASE() function in
the manual.

*RESOLVED*

  Réponse avec citation
 
Page generated in 0,09509 seconds with 9 queries