Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC Affiliate SQL Database Problem


fut

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!

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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
Link to comment
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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...