1054 - Unknown column 'p.designers_id' in 'on clause'

Postate qui discussioni di carattere generale riguardo a problemi di installazione e configurazione di osCommerce

Moderatore: mod Generali

Rispondi
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

1054 - Unknown column 'p.designers_id' in 'on clause'

Messaggio da SonSt4R »

Salve a tutti, ho un sito web che vende mobili www.italy4us.com
Aggiornando alla versione del PHP 5.2 e MySQL 5 ho auto alcuni problemi. Alcuni li ho risolti da solo, ma per molte cose non riesco a mettere mano, perchè la versione di OsCommerce che ho, è stata modificata da un php developer americano che io non conosco.

Ora quando accedo al sito e clicco su un articolo o su una categoria mi da questo errore:

Codice: Seleziona tutto

1054 - Unknown column 'p.products_id' in 'on clause'

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p2c.products_id = s.products_id left join designers d on p.designers_id=d.designers_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '1'
Ho gia letto tantissimi altri post di questo problema, ma nn essendo un esperto di MySQL non so proprio cosa fare...
Ho gia provato a modificare la pagine index.php e la pagina advance_search_result.php, ma nulla.
Mi Aiutate, per favore? E' davvero molto importante per me :cry:

Grazie mille.
Michele
Ultima modifica di SonSt4R il 09/04/2008, 16:18, modificato 2 volte in totale.
-=| SonSt4R |=-
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

vi posto anche (come intende questo post: http://forums.oscommerce.com/index.php?showtopic=230304 ) il file index.php come ce l'ho io:

Codice: Seleziona tutto

<?php
/*
  $Id: index.php,v 1.2 2004/03/09 19:56:29 ccwjr Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

// the following cPath references come from application_top.php
  $category_depth = 'top';
  if (isset($cPath) && tep_not_null($cPath)) {
    $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
    $cateqories_products = tep_db_fetch_array($categories_products_query);
    if ($cateqories_products['total'] > 0) {
      $category_depth = 'products'; // display products
    } else {
      $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
      $category_parent = tep_db_fetch_array($category_parent_query);
      if ($category_parent['total'] > 0) {
        $category_depth = 'nested'; // navigate through the categories
      } else {
        $category_depth = 'products'; // category has no products, but display the 'no products' message
      }
    }
  }

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

	if ($category_depth == 'nested') {
//Code change for Categories Description 1.5
//    $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
//Changed to the following
		$category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
//End Categories Description 1.5

		$category = tep_db_fetch_array($category_query);

		$content = CONTENT_INDEX_NESTED;

	} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['designers_id']) || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
		if(isset($HTTP_GET_VARS['designers_id'])){
    		$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
						 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                         'PRODUCT_LIST_DESIGNER' => "1",
                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

			asort($define_list);

			$column_list = array();
			reset($define_list);
			while (list($key, $value) = each($define_list)) {
				if ($value > 0) $column_list[] = $key;
				//echo $key."<br>";
			}
			//print_r($column_list);
			//die();
	
			$select_column_list = '';

			for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
				switch ($column_list[$i]) {
					case 'PRODUCT_LIST_MODEL':
						$select_column_list .= 'p.products_model, ';
					break;
					case 'PRODUCT_LIST_NAME':
						$select_column_list .= 'pd.products_name, ';
					break;
					case 'PRODUCT_LIST_DESIGNER':
						$select_column_list .= 'm.designers_name, ';
					break;
					case 'PRODUCT_LIST_MANUFACTURER':
						$select_column_list .= 'mm.manufacturers_name, ';
					break;
					case 'PRODUCT_LIST_QUANTITY':
						$select_column_list .= 'p.products_quantity, ';
					break;
					case 'PRODUCT_LIST_IMAGE':
						$select_column_list .= 'p.products_image, ';
					break;
					case 'PRODUCT_LIST_WEIGHT':
						$select_column_list .= 'p.products_weight, ';
					break;
				}
			}
 // Get the category name and description
			$category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
			$category = tep_db_fetch_array($category_query);


// show the products of a specified manufacturer
    		if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
        // We are asked to show only a specific category
        		$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_DESIGNERS . " m, " . TABLE_MANUFACTURERS . " mm, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.designers_id = m.designers_id and p.manufacturers_id = mm.manufacturers_id and m.designers_id = '" . (int)$HTTP_GET_VARS['designers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
		
			} else {
// We show them all
				if((int)$current_category_id!=0){
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " mm, " . TABLE_DESIGNERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = mm.manufacturers_id and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and pd.products_id = p2c.products_id and p.designers_id = m.designers_id and m.designers_id = '" . (int)$HTTP_GET_VARS['designers_id'] . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
				} else {
					$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " mm, " . TABLE_DESIGNERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = mm.manufacturers_id and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.designers_id = m.designers_id and m.designers_id = '" . (int)$HTTP_GET_VARS['designers_id'] . "'";
				}
		
			}
		} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
    		$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
						 'PRODUCT_LIST_DESIGNER' => "1",
                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

			asort($define_list);

			$column_list = array();
			reset($define_list);
			while (list($key, $value) = each($define_list)) {
				if ($value > 0) $column_list[] = $key;
			}

			$select_column_list = '';

			for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
				switch ($column_list[$i]) {
					case 'PRODUCT_LIST_MODEL':
						$select_column_list .= 'p.products_model, ';
					break;
					case 'PRODUCT_LIST_NAME':
						$select_column_list .= 'pd.products_name, ';
					break;
					case 'PRODUCT_LIST_MANUFACTURER':
						$select_column_list .= 'm.manufacturers_name, ';
					break;
					case 'PRODUCT_LIST_DESIGNER':
						$select_column_list .= 'd.designers_name, ';
					break;
					case 'PRODUCT_LIST_QUANTITY':
						$select_column_list .= 'p.products_quantity, ';
					break;
					case 'PRODUCT_LIST_IMAGE':
						$select_column_list .= 'p.products_image, ';
					break;
					case 'PRODUCT_LIST_WEIGHT':
						$select_column_list .= 'p.products_weight, ';
					break;
				}
			}
 // Get the category name and description
    		$category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
    $category = tep_db_fetch_array($category_query);


// show the products of a specified manufacturer
			if (isset($HTTP_GET_VARS['manufacturers_id'])) {
				if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
        // We are asked to show only a specific category
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
		
      			} else {
// We show them all
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
		
		    	}
			} else {
// show the products in a given categorie
      			if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
				} else {
// We show them all
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
				}
			}
		}
		if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
      			$sort_column = CATEGORIES_SORT_ORDER;
      			$sort_order = 'a';
		} else {
				$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
				$sort_column = $column_list[$sort_col-1];
				$sort_order = substr($HTTP_GET_VARS['sort'], 1);
		}
			$listing_sql .= ' order by ';
			switch ($sort_column) {
			  case 'PRODUCT_LIST_MODEL':
				$listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
				break;
			  case 'PRODUCT_LIST_NAME':
				$listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
				break;
			  case 'PRODUCT_LIST_MANUFACTURER':
				$listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
				break;
			  case 'PRODUCT_LIST_QUANTITY':
				$listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
				break;
			  case 'PRODUCT_LIST_IMAGE':
				$listing_sql .= "pd.products_name";
				break;
			  case 'PRODUCT_LIST_WEIGHT':
				$listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
				break;
			  case 'PRODUCT_LIST_PRICE':
				$listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
				break;
			}

			$content = CONTENT_INDEX_PRODUCTS;

	} else { // default page

			$content = CONTENT_INDEX_DEFAULT;

	}

  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
-=| SonSt4R |=-
hsg26
membro Master
membro Master
Messaggi: 1677
Iscritto il: 07/04/2005, 0:00
Località: Svizzera
Contatta:

Messaggio da hsg26 »

bastava cercare: 1054 in questo forum.. è uno degli errori più comuni.

Questa è la patch:

scarica: http://www.oscommerce.com/community/contributions,4654

se fai cerca e sostituisci, qualche volta capita che non ti trovi il codice da cambiare. Oppure capita che tu sbagli quale codice sostituire, magari cancellando qualcosa di troppo, o troppo poco.
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

no, ho cercato già, ho gia scaricato tutto,
ma quello modifica il file index.php dell'oscommerce originale, il mio index.php è diverso dall'originale e non so cosa devo lasciare o modificare... :( ci sono molte variabili in più come il designer e i vari products_prize... nn so cosa modificare di preciso... ti prego aiutami :(
-=| SonSt4R |=-
hsg26
membro Master
membro Master
Messaggi: 1677
Iscritto il: 07/04/2005, 0:00
Località: Svizzera
Contatta:

Messaggio da hsg26 »

SonSt4R ha scritto:no, ho cercato già, ho gia scaricato tutto,
ma quello modifica il file index.php dell'oscommerce originale, il mio index.php è diverso dall'originale e non so cosa devo lasciare o modificare... :( ci sono molte variabili in più come il designer e i vari products_prize... nn so cosa modificare di preciso... ti prego aiutami :(
allora fai così, apri il file incluso, apri un files di oscommerce originale non modificato della versione del tuo oscommerce (la vedi in application_top.php), e verifichi quello che cambia. A quel punto modifichi il tuo inserendo i pezzi diversi e/o aggiunti. Se fai un backup non succede nulla. NON capisco tutta la paura che avete a modificare due files... male che vada c'è il backup e in 2 secondi è tutto come prima.
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

In verità è un pomeriggio che faccio cosi...
non sono tipo che alla prima difficoltà posta sul forum. Ho prima provato da solo, poi ho googlato guardando tutti i forum possibili in italiano e poi in inglese.
Ho anche chiesto ad una persona che ne capisce, ma è impegnato e non poteva darmi una mano.
Questa è l'utima chance che ho e ho postato in questo forum sperando che qualcuno buono d'animo mi possa aiutare.... magavi potevi essere tu... :P

se hai altre cose da dirmi oltre a rimproverarmi per la paura, sono qui tutt'orecchi...o meglio, tutt'okki! :P

^_^
Grazie ancora...
-=| SonSt4R |=-
hsg26
membro Master
membro Master
Messaggi: 1677
Iscritto il: 07/04/2005, 0:00
Località: Svizzera
Contatta:

Messaggio da hsg26 »

ti ho detto quello che avrei fatto io. l'alternativa è che te lo faccio io... eheh
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

mmm non è una idea malvagia XD nono apparte gli scherzi... entro domani devo riuscirci... è importante :) quindi vediamo cosa riesco a fare! :/
-=| SonSt4R |=-
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

Allora ho questa stringa nel mio index.php:

Codice: Seleziona tutto

// show the products of a specified manufacturer
			if (isset($HTTP_GET_VARS['manufacturers_id'])) {
				if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
        // We are asked to show only a specific category
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
		
      			} else {
// We show them all
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
		
		    	}
			} else {
// show the products in a given categorie
      			if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
				} else {
// We show them all
        			$listing_sql = "select " . $select_column_list . " p.products_id, p.designers_id, p.manufacturers_id, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_DESIGNERS . " d on p.designers_id=d.designers_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
				}
			}
e questa nell'originale:

Codice: Seleziona tutto

// show the products of a specified manufacturer
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
     }
   } else {
// show the products in a given categorie
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     }
   }
La domanda che mi pongo da solo e': ma cosa cambia in sintassi? qual'e' la funzione che cambia? in questo modo posso cambiare facilemente le miei query... no?
-=| SonSt4R |=-
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

Dopo questa attenta verifica e parecchio tempo a confrontare,
sono riuscito a capire la differenza tra le versioni, oltre a tutte le cose che differenziavano i due file ci sono delle semplici parentesi prima di ogni left. Basta aggiungere queste parentesi e il gioco è fatto. Non capisco perchè bisogna copiare e sostituire tutto il blocco quando ci sono sono 6 parentesi da aggiungere....

BAH!

Ho risolto, grazie di tutto, e spero che questo post possa essere utile a qualche persona che come me è bisognosa di questo aiuto.

Stay tuned!
-=| SonSt4R |=-
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

Non capisco, ora la categoria funziona, ma il prodotto non è visualizzabile e l'errore è questo:

Codice: Seleziona tutto

1054 - Unknown column 'p.products_id' in 'on clause'

select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_price4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_price8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = '607' and pd.products_id = '607' and pd.language_id = '1'

[TEP STOP]
Ora, ho provato a modificare e aggiungere le parentesi, sia sul file product_info sia su altri files, ma non so dove si trova la query....
Che mi consigliate di fare?
-=| SonSt4R |=-
hsg26
membro Master
membro Master
Messaggi: 1677
Iscritto il: 07/04/2005, 0:00
Località: Svizzera
Contatta:

Messaggio da hsg26 »

un consiglio: verifica di nuovo le differenze tra il file oscommerce base e quello della contribution. è probabile che ci sia qualcosa ancora che non hai cambiato. Ti consiglio di usare un software come winmerge per confrontare i due files.
Avatar utente
SonSt4R
membro Junior
membro Junior
Messaggi: 21
Iscritto il: 13/09/2005, 22:58
Località: Acquaviva Picena
Contatta:

Messaggio da SonSt4R »

grazie cmq del consiglio, ma il problema è che non è una contribution vera e propria...

è tutto un pò stravolto, infatti molti files sono separati, alcuni nelle cartelle del templates, altre nella cartella principale... quindi nn posso confrontare nessun files e non sapendo cove si trovano le query mi trovo un pò spaesato e non so che fare... tu sai x caso in quale file dell'originale si trova quella query? è il file product_info.php x caso?

Grazie ancora! :D
-=| SonSt4R |=-
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

Salve a tutti,
mi intrometto nella discussione perché ho lo stesso problema 1054 nel mio sito.
Ho letto un po' quello che avete scritto e mi sono scaricato la contribution che dovrebbe correggere l'errore. Ho fatto le modifiche richieste e... mi è saltato il sito :lol:
Ho rimesso il vecchio file e ho comparato (tanto per curiosità) la contrib.
Tra la parte dove dice "cerca questo" e "sostituiscilo con l'altro" tutte le differenze che ho trovato sono solo un po' di spazi. Possibile???
vi allego la contrib
Idee???
ciao

Find this...


// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
}
} else {
// show the products in a given categorie
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}
}
-------------------------------------

and replace with this

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
}
} else {
// show the products in a given categorie
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
} else {
// We show them all
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}
}
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

Scusate. Ho ricontrollato e ho visto le fatidiche parentesi.
Sembra tutto a posto ora.
ciao ciao
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Rispondi