Allensbayou Posted March 10, 2008 Posted March 10, 2008 Ok, this is driving me nuts... I have been thru the forums, and none of the contribs or fixes seem to be working for me.. I have checked the database, all fields are there... I just moved to a new server... PHP V5.2.5 MYSQL 5.0.45-comunity.. I have been over and over this... Can someone please tell me what I am doing wrong? the error code is.. 1054 - Unknown column 'p.manufacturers_id' in 'on clause' select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from products p left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c left join manufacturers mnf on p.manufacturers_id = mnf.manufacturers_id left join reviews rvw on p.products_id = rvw.products_id where p.products_image !='' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '43' and p.products_status = '1' order by RAND() limit 9 It's not a beer gut, it's padding for my rock hard abs!
Allensbayou Posted March 10, 2008 Author Posted March 10, 2008 I think the problem is my new products php.. Here is the code.. <!-- new_products //--> <?php if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $sql = "select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from " . TABLE_PRODUCTS . " p left join ".TABLE_SPECIALS." s on p.products_id = s.products_id left join ".TABLE_MANUFACTURERS." mnf on p.manufacturers_id = mnf.manufacturers_id left join ".TABLE_REVIEWS." rvw on p.products_id = rvw.products_id where p.products_image !='' and p.products_status = '1' order by RAND() limit ".MAX_DISPLAY_NEW_PRODUCTS; $new_products_query = tep_db_query($sql); } else { $sql = "select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join ".TABLE_MANUFACTURERS." mnf on p.manufacturers_id = mnf.manufacturers_id left join ".TABLE_REVIEWS." rvw on p.products_id = rvw.products_id where p.products_image !='' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS; $new_products_query = tep_db_query($sql); } Any Ideas? I am still combing the forums, but even after several fixes, and patches, ect... It still fails.. Thanks for any help you can give me.. It's not a beer gut, it's padding for my rock hard abs!
lisabee Posted March 11, 2008 Posted March 11, 2008 I am having the same problem with my client. I replaced all the programs and even the database in case of a hack attack. Same error. I don't think it has anything to do with your program (products.php). I traced through the programs and came up with nothing except the mysql statement is no longer recognizing the table columns correctly in the mysql database. Then I discovered that my client's host just upgraded to php5 and mysql5 (which I noticed your new web host is also running). I suspect it is a case of code (either php or mysql or both) no longer working properly with the newer script languages. Do you know if the latest version of OSCommerce is compatible with php5 and mysql5? We have older versions of OSCommerce and were planning on upgrading to the latest but don't want to go through the process if that won't fix the problem. I hope someone is able to help soon? Our site is down with this error. Lisa
lisabee Posted March 11, 2008 Posted March 11, 2008 I just found another forum post referring to the same type of error (just different table field) that occurred with a php & mysql upgrade to version 5. Follow this link http://www.monikamathe.com/oscommerce/mysql5.txt I followed the instructions and my client's site is now working without the 1054 error. Lisa
Allensbayou Posted March 11, 2008 Author Posted March 11, 2008 I just found another forum post referring to the same type of error (just different table field) that occurred with a php & mysql upgrade to version 5. Follow this link http://www.monikamathe.com/oscommerce/mysql5.txt I followed the instructions and my client's site is now working without the 1054 error. Lisa Yes I tried that as well... As I said, this is driving me nuts.. What's intersting, is I just moved this site from a host using mysql 5 and Php 5 to the new one, Using mysql 5 and php 5, The dbase is fine compairs good. I just can't seem to find the problem here.. And yes, my site is down, kinda, because of this.. When I view the source for the page, it faults right after New products... The index page works fine.. But I just can seem to find the problem.. It's not a beer gut, it's padding for my rock hard abs!
Allensbayou Posted March 11, 2008 Author Posted March 11, 2008 Well, I hope someone can help with this... I have been going over and over the same stuff.. I now see code in my SLEEP!! It's not a beer gut, it's padding for my rock hard abs!
Jan Zonjee Posted March 11, 2008 Posted March 11, 2008 Yes I tried that as well... It is the same MySQL5 issue IMHO... This doesn't give the error, but I don't know if it gives correct results: p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from products p left join manufacturers mnf using(manufacturers_id) left join reviews rvw on p.products_id = rvw.products_id left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c where p.products_image !='' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '43' and p.products_status = '1' order by RAND() limit 9
Allensbayou Posted March 11, 2008 Author Posted March 11, 2008 It is the same MySQL5 issue IMHO... This doesn't give the error, but I don't know if it gives correct results: p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from products p left join manufacturers mnf using(manufacturers_id) left join reviews rvw on p.products_id = rvw.products_id left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c where p.products_image !='' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '43' and p.products_status = '1' order by RAND() limit 9 This is the error code you get? or for the editing of the code? Not sure.. I am STILL 'browsing' to find a solution.. It's not a beer gut, it's padding for my rock hard abs!
Allensbayou Posted March 11, 2008 Author Posted March 11, 2008 I am going over the MYSQL.txt file and most of the code to find in the different php files aren't there or matching.. So I just changed them to what they 'should' be and i still have the problems.. I have a heavily modified os commerce install.. I just can't seem to make this go away.. It's not a beer gut, it's padding for my rock hard abs!
Allensbayou Posted March 12, 2008 Author Posted March 12, 2008 Just trying to keep this up to date.. I just noticed that when I add a new product.. It posts and displays, but I get the error message at the bottom saying.. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOTEBOOK, C610", "http://allensbayou.com/catalog/product_info.php?products_id=20' at line 1 insert into leapfrog (customer_id, customer_name, customer_realname, session_id, ip_address, click_time, page_url, page_title, referer_url, thumb_url) values ("", "Guest", "", "2891bb9b8a8c25e775b97fd87e0e1bd0", "63.170.118.80", "1205284544", "/catalog/product_info.php?products_id=1976&osCsid=2891bb9b8a8c25e775b97fd87e0e1bd0", "DELL LATITUDE C610 14.1" NOTEBOOK, C610", "http://allensbayou.com/catalog/product_info.php?products_id=2040&osCsid=2891bb9b8a8c25e775b97fd87e0e1bd0", "c6103.jpg") [TEP STOP] For adding a dell laptop, obviousely.. but even editeding exsisting products I get the error.. but the products already added have no problems... Any Ideas? (going crazy!) It's not a beer gut, it's padding for my rock hard abs!
Jan Zonjee Posted March 12, 2008 Posted March 12, 2008 Just trying to keep this up to date..I just noticed that when I add a new product.. It posts and displays, but I get the error message at the bottom saying.. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOTEBOOK, C610", "http://allensbayou.com/catalog/product_info.php?products_id=20' at line 1 DELL LATITUDE C610 14.1": And you think MySQL is smart enough to think "Oh, this quote is meant to be an inch so I will not consider this the end of the field? No, but there is an osC function tep_db_input I think it is named that take cares of that (adds slashes). Obviously the maker of the contribution didn't realize there could be people using quotes in there page titles.
Allensbayou Posted March 12, 2008 Author Posted March 12, 2008 DELL LATITUDE C610 14.1": And you think MySQL is smart enough to think "Oh, this quote is meant to be an inch so I will not consider this the end of the field? No, but there is an osC function tep_db_input I think it is named that take cares of that (adds slashes). Obviously the maker of the contribution didn't realize there could be people using quotes in there page titles. Yes I fixed this one... I just got my head so far into this that I missed that... But... $sql = "select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from " . TABLE_PRODUCTS . " p left join ".TABLE_SPECIALS." s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join ".TABLE_MANUFACTURERS." mnf on p.manufacturers_id = mnf.manufacturers_id left join ".TABLE_REVIEWS." rvw on p.products_id = rvw.products_id where p.products_image !='' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS; $new_products_query = tep_db_query($sql); Can anyone tell me what is wrong with this part? I just can't seem to get it... EVERYTHING else works, just this part doesn't It's not a beer gut, it's padding for my rock hard abs!
Jan Zonjee Posted March 12, 2008 Posted March 12, 2008 Can anyone tell me what is wrong with this part? See post 7
Allensbayou Posted March 12, 2008 Author Posted March 12, 2008 See post 7 First, thank you for all your help and suggestions, I know you probably have other things to do besides help me.. But I don't think I'm getting this... Post #7 Looks like the error code... With the code I need help with is using Select distinct, table products, ect.. It looks nothing like the code in post 7. This is the new_products Select Distinct code.. The only part of my site currently not working... It's not a beer gut, it's padding for my rock hard abs!
Jan Zonjee Posted March 12, 2008 Posted March 12, 2008 Post #7 Looks like the error code...With the code I need help with is using Select distinct, table products, ect.. It looks nothing like the code in post 7. Not if you are clueless about sql (although I missed the first line). But then you could have fixed it yourself. Can you understand it now? <!-- new_products //--> <?php if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $sql = "select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from " . TABLE_PRODUCTS . " p left join ".TABLE_SPECIALS." s on p.products_id = s.products_id left join ".TABLE_MANUFACTURERS." mnf on p.manufacturers_id = mnf.manufacturers_id left join ".TABLE_REVIEWS." rvw on p.products_id = rvw.products_id where p.products_image !='' and p.products_status = '1' order by RAND() limit ".MAX_DISPLAY_NEW_PRODUCTS; $new_products_query = tep_db_query($sql); } else { $sql = "select distinct p.products_id, p.products_quantity, p.products_image, p.products_model, p.products_tax_class_id, p.products_weight, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from " . TABLE_PRODUCTS . " p left join ".TABLE_MANUFACTURERS." mnf using(manufacturers_id) left join ".TABLE_REVIEWS." rvw on p.products_id = rvw.products_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_image !='' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS; }
Allensbayou Posted March 12, 2008 Author Posted March 12, 2008 Thank you... I will compare this code... It's not a beer gut, it's padding for my rock hard abs!
halluzineyt Posted March 3, 2010 Posted March 3, 2010 Thank you... I will compare this code... }} you still active can i have some idea how to fix leap frog?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.