Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pls Help. 1054 - Unknown column 'approved'


User Name

Recommended Posts

I recently installed the Review Approval System. After doing so I now receive the following error on any product I select from my site.

 

1054 - Unknown column 'approved' in 'where clause'

 

select count(*) as count from reviews where approved = 1 and products_id = '45' :(

 

I changed any code modifications back to the way they were before i used the contribution and removed all the files that came with it. Yet I still get this message when I view any of my products. Could someone please possibly help me or point me in some sort of direction? Thanks.

Link to comment
Share on other sites

unless you went thru the code line by line, tough to get it back to 'original'. the code is still looking for approval, thus to remove it completely compare all the files which were modified by the contribition with the original, use beyond compare or something like that. or copy original osCommerce over the site and it will be back to normal.

Link to comment
Share on other sites

check the queries on the product_info page to see where the word approved appears.

 

did you run the sql that came with the contrib ?

 

 

Well there was no sql that came with the contrib. I just went back and downloaded it again. Its not in there. Im obviously missing something? After I first saw that error I did get the impressions that there should have been one.

 

If you want to see exactly what im referring to you can look at the error here.

 

http://www.techno-tronics.com/storefront

 

Just click on one of the products.

 

I really appreciate the input..

Link to comment
Share on other sites

check the queries on the product_info page to see where the word approved appears.

 

did you run the sql that came with the contrib ?

 

I appologise Im very new to OSC. May I also ask, when you say check the queries on the product_info page to see where the word appears, what do you mean? How do I do this?

Link to comment
Share on other sites

I appologise Im very new to OSC. May I also ask, when you say check the queries on the product_info page to see where the word appears, what do you mean? How do I do this?

 

 

Hey Greg,

 

If you are talking about the Review Approval System v1.2 contribution, then there is a sql statement there. It is in the file : review_approve.sql

 

it looks like this:

 

ALTER TABLE `reviews` ADD `approved` TINYINT(3) UNSIGNED DEFAULT "0"

 

 

As you can see it creates a column "approved" in your reviews table.

 

So if you want to totally remove this contrib, you will need to remove this column from the table (using phpadmin, or whatever.)

 

Also the edits where done to the file product_reviews.php, and review.php in the catalog. I would look there for the codes relating to the approved column.

 

I belive it will be around line 93 or so (my site is modded a bunch) the line will look like:

 

$reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.approved = '1' order by r.reviews_id desc";

 

Also note that you need to remove the edits from all the files (so also do reviews.php in the catalog, as well as the files that needed editing in the admin area).

 

I hope this helps a bit,

 

RavenWulf

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...