Welcome Guest, Not a member yet? Register   Sign In
Connecting to database on the fly
#1

[eluser]Azhari Harahap[/eluser]
Hi.

Is there any way to connecting to database on the fly?

For example, i have form contain username, password, host, database name, it's used to connect to the database, when form submitted, i want to connect to database temporarily, do some query (create database), then later i save it (username, password, host, db) to the database.php file.
#2

[eluser]Cro_Crx[/eluser]
Why not just write the settings to the database.php file and then try to connect with the settings within the file ?

Sorry, I read over the creating a database part just then. Unless your making an application like phpMyAdmin I would suggest strongly against having the script create a database on the server. You should create one before running the script and specify what it is. It's very possible to do what you want, although from a security standpoint, just don't.




Theme © iAndrew 2016 - Forum software by © MyBB