Jump to content
Sign in to follow this  
fut

OSC Affiliate SQL Database Problem

Recommended Posts

I recently attmpted to install the OSC Affiliate module. I came across a problem with the database upgrade.

 

When importing the upgrade named affilaite.sql -> the browser asked me "do I really want to DROP TABLE IF EXISTS affiliate_sales;

CREATE TABLE affiliate_sales ( ?"

 

I said yes and didn't think anything of it.

 

Now when everything seemed complete, when attempting to visit my admin page I get this error:

 

1146 - Table 'crazyj61_store.TABLE_AFFILIATE_SALES' doesn't exist

 

select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from TABLE_AFFILIATE_SALES

 

 

So I wen't back to phpmyadmin, manually deleted the table affiliate_sales (that was in fact there), copied and pasted the EXACT code again from the affiliate.sql file that came from with the module and again the browser asked me the same thing -> again the same error pops up when attempting to visit my admin.

 

Does anyone know what I could be doing wrong here?

 

Thanks!

Share this post


Link to post
Share on other sites

There should be some changes to admin/includes/database_tables.php. Double check those. You should have an entry for TABLE_AFFILIATE_SALES

Share this post


Link to post
Share on other sites
There should be some changes to admin/includes/database_tables.php. Double check those. You should have an entry for TABLE_AFFILIATE_SALES

 

Hi, that got me somewhere.

 

I had to add

  define('TABLE_AFFILIATE_SALES', 'affiliate_sales');
 define('TABLE_AFFILIATE_CLICKTHROUGHS', 'affiliate_clickthroughs');

 

to admin/includes/database_tables.php but am now faced with this error:

 

1146 - Table 'crazyj61_store.TABLE_AFFILIATE' doesn't exist

select count(*) as count from TABLE_AFFILIATE

 

The problem with this one is that this time I really do not have a table called "affiliate" in my database nor is it in the sql file. I have one called affiliate_affiliate, however -> is that the same one they are talking about? Am I going about this the right way?

 

Thanks for input.

Share this post


Link to post
Share on other sites

if it means anything, the sql file itself is called affiliate.sql -> i didn't import the file from text, rather, i just copy and pasted the code from inside affiliate.sql -> i don't think that matters though.

Share this post


Link to post
Share on other sites

I found out where it calls for the table "AFFILIATE". The module states to add the following code in my index.php admin side.

 

$affiliates_raw = "select count(*) as count from " . TABLE_AFFILIATE . "";

$affiliates_raw_query=tep_db_query($affiliates_raw);

$affiliates_raw = tep_db_fetch_array($affiliates_raw_query);

$affiliate_number= $affiliates_raw['count'];

 

 

there is a file called "affiliate.php" but there is no code to create a table called "affiliate" in the sql.

 

Does anyone know what code I should add to the sql for the table "affiliate" - why do you figure I am the only one having this problem?

 

Thanks.

Share this post


Link to post
Share on other sites

argh, this is so frutratiing. i tried to delete everything but now i still get the same error. I am worse than where I started. I made a backup of my sql file before doing this but phpmyadmin is having problems restoring it.

Share this post


Link to post
Share on other sites

You are not calling the file that defines your database tables - affiliate_application_top.php - run through the installation instructions under CATALOG ALTERATIONS - it states:

 

In application_top.php in the catalog/includes directory enter at the end of the file before ?>:

 

// Include OSC-AFFILIATE

? require(DIR_WS_INCLUDES . 'affiliate_application_top.php');

 

There is more you have probably missed :D

 

 

Matti

Edited by Johnson

Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites

Hi Johnson,

 

Wow that cleared up a lot for me. I know exactly where I wen't wrong. In my haste, I thought that the new install meant only for fresh OS Commerce installs, not a new install of the module. Stupid mistake - nonetheless, I still have another small problem.

 

I do not want to have the affiliate box on my index.php page - i'd like it to be on a seperate page (e.g. I used affiliater.php) - however, when I click on any of the links (Affiliate Information Affiliate Program FAQ Affiliate Log In) I get this error

 

 

Fatal error: Cannot redeclare preorder() (previously declared in /home/crazyj61/public_html/includes/boxes/categories.php:17) in /home/crazyj61/public_html/includes/boxes/categories.php on line 17

 

Is there anyway to get this working on a totally seperate page not on my index.php page?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×