Quote:
Originally Posted by chrishirst
That depends on how your code sets up the database and the tables to query.
|
Ok
Let me try again.
I have two equal copies of one website.
1 is website.us, another is website.co.uk
boyh independent websites saves data into on only database that has two tables: main_USA and main_UK
The websites are working fine independently.
Bu if I have domais for most of worls countries. Now, the way I'm doing it I end up with about 90 websites.
My question is instead of all websites how can I use only one.
Every website has an include file called connect.php
?
$connect=mysql_connect ("localhost", "root", "root") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("databasename", $connect) or die ("Impossible to connect to Data Base");
$sql = "SELECT id, country, countryisocode, countryphonecode, cityphone, agent, name, phone, mobile, fax, email FROM `inter_agents` WHERE country='usa' limit 1";
$result=mysql_db_query("databasename",$sql);
$regist=mysql_fetch_array($result);
$id1=$regist["id"];
$country=$regist["country"];
$code1=$registo['countryisocode'];
$code2=$registo[countryphonecode];
$code3=$registo[cityphonecode];
$agent=$registo['agent'];
$name=$registo['name'];
$phone=$registo['phone'];
$mobile=$registo['mobile'];
$fax=$registo['fax'];
$email=$registo['email'];
?>
to call the country in the table of database:
$sql="select * from inter_agents where country=".countryisocode."' and activ='1'";