/*
SECTION 1: MANUAL INSTALLATION
SECTION 2: WEB INSTALLATION
*/

Preamble: 

There are two methods of installation covered in this document. The easiest and most expedient one is the standard Web installation - ou should try this first. If, however, you run into problems, then the manual installation is a fallback.

SECTION 1) MANUAL INSTALLATION

Step 1:

Donwload and extract the files to your desired directory.

Step 2:

Install the database tables in the desired database. The SQL commands for the PHPMyAffiliate tables are show here:


 CREATE TABLE `phpmy_admins` (
  `id` int(4) NOT NULL auto_increment,
  `username` varchar(65) NOT NULL default '',
  `email` varchar(150) NOT NULL default 'admin@localhost',
  `password` varchar(65) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=0;

CREATE TABLE `phpmy_advertisers` (
  `id` int(4) NOT NULL auto_increment,
  `advertiser` varchar(150) NOT NULL default 'Default',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=0;

CREATE TABLE `phpmy_categories` (
  `ID` int(5) NOT NULL auto_increment,
  `Category` varchar(120) NOT NULL default '',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `Category` (`Category`)
) TYPE=MyISAM AUTO_INCREMENT=0;

CREATE TABLE `phpmy_links` (
  `id` int(11) NOT NULL auto_increment,
  `date_added` date NOT NULL default '0000-00-00',
  `expiry` date NOT NULL default '0000-00-00',
  `category` smallint(5) NOT NULL default '1',
  `advertiser` varchar(120) default NULL,
  `link` text NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=0;


Step 3:

Add your database access settings to the db.php file (You will need  to create this in the phpmyaffiliates folder so make sure you have permission to create a file in this directory). The format is as follows:

<?
 define('phpmy_server', 'localhost'); 
 define('phpmy_username', 'your_username');
 define('phpmy_password', 'your_password');
 define('phpmy_database', 'your_database');
?>

Remember to insert the correct values for your setup in place of the values beginning with "your_". Save the changes!

Step 4:

Set the permissions on db.php to 0400 in order to prevent unwanted third parties from getting their grubby paws on your config information.


Step 5:

You will need to add an administrative user with password and email address to the phpmy_admins table. Something like this will suffice:

insert into phpmy_admins (username, email, password) values ('Admin', 'staff@mysite.com', password('mypassword'));

Ensure that you insert values that are relevant to yourself. Once this is done you should be able to make use of PHPMyAffiliates by visiting:

http://www.yourdomain.com/phpmyaffiliates

We hope you enjoy PHPMyAffiliates and find it helpful...

SECTION 2) WEB INSTALLATION

Step 1:

Download and extract the files to your desired directory

Step 2:

Visit the directory you unpacked PHPMyAffiliates in (i.e. http://www.infobuoy.com/phpmyaffiliates)

Step 3:

Follow the instructions! It helps to have information like:

Your database name
A user and password with sufficient permission to install tables

WARNING: If you already have tables called phpmy_categories,phpmy_links,phpmy_admins,phpmy_advertisers in your database then you need to make a back up or change these tables as PHPMyAffiliates will drop these tables in order to make room for its own requirements.

We hope you enjoy PHPMyAffiliates and find it helpful...