I use to take a PHP class a long time ago, but I have not really used it. I am controlling like a bunch of websites, and I want to add links to all of them. How do I set it up so that when I just add a link to like the database or whatever, they will all be updated? I do not have to do it manually? Also How do I set up the database?
What he said. As far as setting up the database, just set up the database through cPanel (if you've got it), and use phpmyadmin and create a table in the database with your desired columns.
if you have your sites on multiple domains, you cannot use the same mysql database, in that case i'd go for an xml solution: * set up an old version of phplinkdirectory on one site and maintain your links in it * write a phpscript to dump the links to an xml file * use simpleXml from other sites to request that xml-page, parse and list the links
I didnt get that one to work a while back, I figured I'd use XML instead. but if it normally works i stand corrected.
Use following code <?php $db[] = array("host"=>"host1", "user"=>"user1", "pwd"=>"paassword1", "dbname"=>"db1"); $db[] = array("host"=>"host2", "user"=>"user2", "pwd"=>"paassword2", "dbname"=>"db1"); $db[] = array("host"=>"host3", "user"=>"user3", "pwd"=>"paassword3", "dbname"=>"db1"); $db[] = array("host"=>"host4", "user"=>"user4", "pwd"=>"paassword4", "dbname"=>"db1"); foreach ($db as $info) { $link = mysql_connect($info["host"], $info["user1"], $info["pwd"]); mysql_select_db($info["dbname"], $link); mysql_query("Update link", $link); mysql_close($link); } ?> Code (markup):