You are not logged in.
Pages: 1
I have this website: http://www.buyindie.net that is purely for DC at the moment. I like the concept and some friends have expressed interest in expanding it to other cities. Since I'm short of hardware (only 1 box) I'd like to have all the different cities on one machine. Is it possible to do that? Right now I'm using MySQL and it's set up as 1 master db with seperate tables for store, votes, comments, etc.
Is there any way to keep the data structure but have clean data for the different cities?
Offline
I love the concept behind your site. Nice job. Sorry I can't answer your question.
Offline
well i'm not quite sure if that is what you mean but you could always authorize other servers to be syncing you db and run as slave. that should be documented well enough on mysql.com. no idea what exactly you're looking for though heh
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
no idea what exactly you're looking for though heh
What I'm basically trying to do is have dc.buyindie.net sf.buyindie.net la.buyindie.net etc all running from one computer. *Note those urls don't exist yet.) Since the data will be different from dc to sf there needs to be some seperation, but the data structure (fields, types, etc) will be the same across all databases. Since it's one box I don't know how to do it..
Offline
I have this website: http://www.buyindie.net that is purely for DC at the moment. I like the concept and some friends have expressed interest in expanding it to other cities. Since I'm short of hardware (only 1 box) I'd like to have all the different cities on one machine. Is it possible to do that? Right now I'm using MySQL and it's set up as 1 master db with seperate tables for store, votes, comments, etc.
Is there any way to keep the data structure but have clean data for the different cities?
I hope I understood the question... but what you want to do is *not* use the master db, but create individual dbs per website...
for instance, let's say you have 5 sites, named: zach, jesse, ac, lisa, and screech...
create database zach_buyindie
create database jesse_buyindie
create database ac_buyindie
create database lisa_buyindie
create database screech_buyindie
then you just change your connection information in some sort of config file
function opendb($name, $host, $user, $pass)
{
var $blark = 0
$blark = @mysql_connect($host, $user, $password);
if($blark) @mysql_select_db($name, $blark);
return $blark;
}
var $zachdb = opendb("zach_buyindie","localhost","zach","morris");
(you should also create specific users per database too - i.e. the "zach" user will only have access to the "zach_buyindie" database)
disclaimer: I'm not a php guru, and the above may not work verbatim... but it should be close enough (I have no clue what the @ signs are for, but they were in what I used as a reference... maybe it has something to do with classes)
Offline
Pages: 1