PDA

View Full Version : Multi installer?


thesavior
01-29-2006, 12:13 AM
Lets say i have a forum script. I want to allow people to sign up for a free board. How would i create the mysql tables, and how can i make it so that i can change a main file, and only have to edit one, and that will go to everyone's folder. Also, I somehow need to do the same kind of thing with the database tables so that i can add a column to a table and it will go to everything.

Do you guys have any ideas on how to create something where i have one main directory holding the master script, then a bunch of folders that work off of that?

fci
01-29-2006, 01:59 AM
you would do something like this:
include('/var/master_files/master.php');
/* and so on */

ideally you would have an all in one 'manager' you've written to modify tables across multiple databases. if you setup the mysql users in a decent manner, you should be able to have a 'master' user who's allowed to alter tables and create databases and so on. you can also create your tables by doing something like this (although maybe not the most ideal):
<?php
`mysql -u blahusername -p blahpassword < your_tables.sql`;
?>

thesavior
01-29-2006, 02:01 AM
huh...but if every forum connects to different databases, how would that work? Would you have a general connect, then define the variables in a specific file in each folder?

fci
01-29-2006, 02:19 AM
does this help?
config.php:
<?php
$db = array('name' => ..., 'user' => ..., 'blah' => ...);
include('/path/to/master.php');
?>

then master.php could get all the files/variables you want in scope.

thesavior
01-29-2006, 03:41 AM
hmm...maybe. I think this is way beyond my abilities, so i might just get someone to do it for me. Thanks for your help.

GJay
01-29-2006, 11:06 AM
Stick a column in every table that references the forum, creating new tables/databases is probably not going to be the most efficient method.