Re: Re: mysql_query - CREATE DATABASE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thank you.



On Mon, Feb 9, 2009 at 1:14 PM, Shawn McKenzie <nospam@xxxxxxxxxxxxx> wrote:

> R B wrote:
> > I´m looking that i have another problem:
> >
> > I´m making a software to install in any server.
> >
> > The software needs a database, so i want to create a script install.php
> > to create the database when this script is executed.
> >
> > At this point of the instalation, i don´t know none of the users that are
> > defined in mysql.
> >
> > If i use this command:
> >
> > mysql_query("CREATE DATABASE my_db",$con)
> >
> > first i need to connect to mysql with the command
> >
> > mysql_connect
> >
> > But at this point, i don´t know none of the users that are defined in
> mysql.
> >
> > So, what i do in this case?
> >
> > Thanks
> >
> >
>
> Well, obviously the user will have to supply the username and password.
>  There's no way around that.  So after you know the username you can
> create the db and then check if the db exists as you have named it
> (my_db), and if not check for ($username_my_db), if not that then one of
> the examples I gave you, or just skip right to listing the databases.
>
>
> --
>  Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux