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

Reply via email to