". $sql ." : ". mysql_error() ."
";} } $db5 = mysql_connect("localhost",$ADMIN_NAME,$ADMIN_PWD) or die("Could not connect to database."); $sql = "CREATE DATABASE `". $NEW_DB_NAME ."` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci"; $result = mysql_query($sql); if (!$result) {echo "
". $sql ." : ". mysql_error() ."
";} $sql = "USE `". $NEW_DB_NAME ."`"; db_query($sql); $sql = "CREATE USER '". $NEW_USER ."'@'localhost' IDENTIFIED BY '". $NEW_PWD ."'"; db_query($sql); $sql = "GRANT SELECT,INSERT,UPDATE,DELETE on ". $NEW_DB_NAME .".* to `". $NEW_USER ."`@`localhost`"; db_query($sql); /* -- phpMyAdmin SQL Dump -- version 2.9.1.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Apr 22, 2009 at 05:51 PM -- Server version: 5.0.37 -- PHP Version: 5.2.0 -- -- -------------------------------------------------------- -- -- Table structure for table `brand` -- */ $sql = "CREATE TABLE `brand` ( `status_code` tinyint(3) unsigned NOT NULL, `created_on` timestamp NOT NULL default '2008-01-01 00:00:01', `updated_on` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP, `log_no` int(11) NOT NULL auto_increment, `brand_name` varchar(50) NOT NULL, `units` varchar(20) NOT NULL default '0', `email` varchar(50) NOT NULL, `alt_email` varchar(50) NOT NULL, `period` varchar(10) NOT NULL, PRIMARY KEY (`log_no`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7" ; db_query($sql); /* -- -------------------------------------------------------- -- -- Table structure for table `journal` -- */ $sql = "CREATE TABLE `journal` ( `status_code` tinyint(3) unsigned zerofill NOT NULL default '000', `entered_on` timestamp NOT NULL default '2008-01-01 00:00:01', `updated_on` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP, `log_no` int(10) unsigned NOT NULL auto_increment, `from_link` varchar(200) NOT NULL default '0', `to_link` varchar(200) NOT NULL default '0', `record` varchar(200) NOT NULL default '0', `reporter` varchar(50) NOT NULL default '0', PRIMARY KEY (`log_no`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 "; db_query($sql); mysql_close($db5); //closes admin connection //a new connection is created to test the set-up of the new user $db5 = mysql_connect("localhost",$NEW_USER,$NEW_PWD) or die("Could not connect to database."); mysql_select_db($NEW_DB_NAME,$db5); /* -- -- Dumping data for table `brand` -- */ $sql ="INSERT INTO `brand` (`status_code`, `created_on`, `updated_on`, `log_no`, `brand_name`, `units`, `email`, `alt_email`, `period`) VALUES (0, '2008-01-01 00:00:01', '2008-11-25 17:20:24', 1, 'localhost/wordpress', 'dollar', '0', '0', '2008-11-01'), (0, '2008-01-01 00:00:01', '2008-11-25 17:20:24', 2, 'localhost/currency', 'dollar', '0', '0', '2008-11-01'), (0, '2008-01-01 00:00:01', '2008-12-20 19:47:47', 3, 'newicb.blogspot.com', 'units', '0', '0', '2009'), (0, '2008-01-01 00:00:01', '2008-12-20 19:42:07', 4, 'icb2.blogspot.com', 'units', '0', '0', '2009')"; db_query($sql); /* -- -- Dumping data for table `journal` -- */ $sql = "INSERT INTO `journal` (`status_code`, `entered_on`, `updated_on`, `log_no`, `from_link`, `to_link`, `record`, `reporter`) VALUES (002, '2008-12-20 19:52:14', '2008-12-20 19:52:14', 1, 'http://newicb.blogspot.com/search?q=2008-12-19+from+newicb.blogspot.com+to+icb2.blogspot.com+100.00+dollar+%23494c6cea.', 'http://icb2.blogspot.com/search?q=2008-12-19+from+newicb.blogspot.com+to+icb2.blogspot.com+100.00+dollar+%23494c6cea.', '2008-12-19 from newicb.blogspot.com to icb2.blogspot.com 100.00 dollar #494c6cea.', '0'), (000, '2008-12-21 08:05:37', '2008-12-21 08:07:01', 2, 'http://icb2.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', 'http://newicb.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', '2008-12-20 from icb2.blogspot.com to newicb.blogspot.com 9.00 units #dea34.', ''), (000, '2008-12-21 08:11:38', '2008-12-21 08:20:01', 3, 'http://icb2.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', 'http://newicb.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', '2008-12-11 from icb2.blogspot.com to newicb.blogspot.com 9.00 units #dea34.', ''), (000, '2008-12-21 08:20:13', '2008-12-21 08:23:46', 4, 'http://icb2.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', 'http://newicb.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', '2008-12-22 from icb2.blogspot.com to newicb.blogspot.com 9.00 units #dea34.', ''), (000, '2008-12-21 08:23:55', '0000-00-00 00:00:00', 5, 'http://icb2.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', 'http://newicb.blogspot.com/?prowl=2008-12-21+from+icb2.blogspot.com+to+newicb.blogspot.com+9.00+units+%23dea34.', '2008-12-21 from icb2.blogspot.com to newicb.blogspot.com 9.00 units #dea34.', ''), (000, '2008-12-21 19:05:55', '2008-12-21 19:07:18', 6, 'http://newicb.blogspot.com/?prowl=2008-12-21+from+newicb.blogspot.com+to+icb2.blogspot.com+38.00+units+%23ef111.', 'http://icb2.blogspot.com/?prowl=2008-12-21+from+newicb.blogspot.com+to+icb2.blogspot.com+38.00+units+%23ef111.', '2008-12-11 from newicb.blogspot.com to icb2.blogspot.com 38.00 units #ef111.', ''), (000, '2008-12-21 19:09:06', '0000-00-00 00:00:00', 7, 'http://newicb.blogspot.com/?prowl=2008-12-21+from+newicb.blogspot.com+to+icb2.blogspot.com+38.00+units+%23ef111.', 'http://icb2.blogspot.com/?prowl=2008-12-21+from+newicb.blogspot.com+to+icb2.blogspot.com+38.00+units+%23ef111.', '2008-12-21 from newicb.blogspot.com to icb2.blogspot.com 38.00 units #ef111.', ''), (000, '2008-12-22 19:43:49', '0000-00-00 00:00:00', 8, 'http://icb2.blogspot.com/?prowl=2008-12-22+from+icb2.blogspot.com+to+newicb.blogspot.com+79.00+units+%23ffc9d.', 'http://newicb.blogspot.com/?prowl=2008-12-22+from+icb2.blogspot.com+to+newicb.blogspot.com+79.00+units+%23ffc9d.', '2008-12-22 from icb2.blogspot.com to newicb.blogspot.com 79.00 units #ffc9d.', ''), (000, '2008-12-25 19:27:01', '2008-12-25 19:30:37', 9, 'http://icb2.blogspot.com/?prowl=2008-12-25+from+icb2.blogspot.com+to+newicb.blogspot.com+71.00+units+%235f889.', 'http://newicb.blogspot.com/?prowl=2008-12-25+from+icb2.blogspot.com+to+newicb.blogspot.com+71.00+units+%235f889.', '2008-12-24 from icb2.blogspot.com to newicb.blogspot.com 71.00 units #5f889.', '0'), (000, '2008-12-25 21:44:55', '0000-00-00 00:00:00', 10, '', '', '2008-12-25 from newicb.blogspot.com to icb2.blogspot.com 18.00 units #46838.', '0'), (000, '2008-12-25 21:48:57', '0000-00-00 00:00:00', 11, '', '', '2008-12-25 from newicb.blogspot.com to icb2.blogspot.com 18.00 units #96838.', '0'), (000, '2009-04-21 10:50:37', '0000-00-00 00:00:00', 12, 'tyaga.org', 'tyaga.org', '2009-04-09 from newicb.blogspot.com to icb2.blogspot.com 37.00 units #dddcc.', '0')"; db_query($sql); ?>