Catalogo stampabile

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

Moderatore: mod Generali

Rispondi
psychostore
membro Junior
membro Junior
Messaggi: 27
Iscritto il: 31/01/2004, 1:00
Località: Italia
Contatta:

Catalogo stampabile

Messaggio da psychostore »

Salve a tutti.

Stiamo alacremente lavorando al completamento del nostro sito e nel frattempo lo abbiamo "aperto ai visitatori".

Ci siamo resi conto che va alla grande e stiamo cercando, se possibile, di renderlo più rispondente alle nostre esigenze.

Abbiamo perciò installato la contrib. "print_catalog v1.1" per dare agli utenti la possibilità di disporre anche di un catalogo su carta oltre che di quello on line.

Tutto sembra funzionare bene (i file sono al loro posto, nel box Informazioni appare la scritta relativa, etc.) fino a che non si clicca sul link apposito.

Si apre la pagina apposita con questo errore:

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 'select p.products_id, pd.products_name, pd.products_descript

select count(select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, cd.categories_name, m.manufacturers_name from products p left join products_to_categories p2c on p.products_id=p2c.products_id left join categories c on p2c.categories_id=c.categories_id left join categories_description cd on c.parent_id=\'0\' and c.categories_id=cd.categories_id left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = \'1\' left join specials s on p.products_id = s.products_id where products_status = \'1\' order by cd.categories_name, c.parent_id, c.sort_order, c.categories_id, pd.products_name) as total

[TEP STOP]

Per il momento l'abbiamo sostituita con una pagina di cortesia.

Qualcuno può darci una mano?

Grazie.
BluEdoG
membro Master
membro Master
Messaggi: 1064
Iscritto il: 25/05/2003, 0:00
Località: italia
Contatta:

Re: Catalogo stampabile

Messaggio da BluEdoG »

psychostore ha scritto:select count(select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, cd.categories_name, m.manufacturers_name from products p left join products_to_categories p2c on p.products_id=p2c.products_id left join categories c on p2c.categories_id=c.categories_id left join categories_description cd on c.parent_id=\'0\' and c.categories_id=cd.categories_id left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = \'1\' left join specials s on p.products_id = s.products_id where products_status = \'1\' order by cd.categories_name, c.parent_id, c.sort_order, c.categories_id, pd.products_name) as total
perchè c'è una parentisi li dentro?
saluti, Caneblu
[ www.caneblu.com ]
psychostore
membro Junior
membro Junior
Messaggi: 27
Iscritto il: 31/01/2004, 1:00
Località: Italia
Contatta:

Messaggio da psychostore »

Salve.
Grazie per la risposta.

La parentesi di cui parli immagino sia quella sottolineata in neretto.

Nel file "print_catalog" della contrib. la parentesi non è presente mentre appare nel messaggio di errore che ho postato.

la parte di file che genera l'errore è la seguente:

<?php
$print_catalog_query_raw = "select p.products_id, pd.products_name,
pd.products_description, p.products_model, p.products_image, p.products_price,
p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as
specials_new_products_price, p.products_date_added, cd.categories_name,
m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id=p2c.products_id left join
" . TABLE_CATEGORIES . " c on p2c.categories_id=c.categories_id left join " .
TABLE_CATEGORIES_DESCRIPTION . " cd on c.parent_id='0' and
c.categories_id=cd.categories_id left join " . TABLE_MANUFACTURERS . " m on
p.manufacturers_id = m.manufacturers_id left join " .
TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and
pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on
p.products_id = s.products_id where products_status = '1' order by
cd.categories_name, c.parent_id, c.sort_order, c.categories_id,
pd.products_name";

$print_catalog_split = new splitPageResults($HTTP_GET_VARS['page'],
MAX_DISPLAY_PRINT_CATALOG, $print_catalog_query_raw, $print_catalog_numrows);

$print_catalog_query = tep_db_query($print_catalog_query_raw);
while ($print_catalog = tep_db_fetch_array($print_catalog_query)) {
$print_catalog_array[] = array('id' =>
$print_catalog['products_id'],
'name' =>
$print_catalog['products_name'],
'description' =>
$print_catalog['products_description'],
'model' =>
$print_catalog['products_model'],
'image' =>
$print_catalog['products_image'],
'price' =>
$print_catalog['products_price'],
'specials_price' =>
$print_catalog['specials_new_products_price'],
'tax_class_id' =>
$print_catalog['products_tax_class_id'],
'date_added' =>
tep_date_long($print_catalog['products_date_added']),
'manufacturer' =>
$print_catalog['manufacturers_name']);
}
?>


e, come vedi, la parentesi non c'è.

Quale potrebbe essere il problema?

:roll:
BluEdoG
membro Master
membro Master
Messaggi: 1064
Iscritto il: 25/05/2003, 0:00
Località: italia
Contatta:

Messaggio da BluEdoG »

adesso vedo che la parentesi è giustificata da "select count(" all'inizio della select. Cosa che pero' non vedo nel secondo post. O si tratta di un'altra select oppure c'e una istruzione prima che rende errata l'istruzione (anche perche select count con una select normale ingabbiata dentro la prima non mi pare sia sintatticamente corretto)
saluti, Caneblu
[ www.caneblu.com ]
Avatar utente
Simona67
membro Veteran
membro Veteran
Messaggi: 786
Iscritto il: 10/11/2003, 1:00
Località: Milano
Contatta:

Messaggio da Simona67 »

Ciao BluEdoG,

Anch'io ho installato print_catalog e guarda che errore mi da?

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 'select p.products_id, pd.products_name, pd.products_descrip

select count(select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, cd.categories_name, m.manufacturers_name from products p left join products_to_categories p2c on p.products_id=p2c.products_id left join categories c on p2c.categories_id=c.categories_id left join categories_description cd on c.parent_id=\'0\' and c.categories_id=cd.categories_id left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = \'4\' left join specials s on p.products_id = s.products_id where products_status = \'1\' order by cd.categories_name, c.parent_id, c.sort_order, c.categories_id, pd.products_name) as total

Cosa devo fare?

Perfavore aiutami? :oops: :lol:
BluEdoG
membro Master
membro Master
Messaggi: 1064
Iscritto il: 25/05/2003, 0:00
Località: italia
Contatta:

Messaggio da BluEdoG »

non conosco la contrib ma secondo me c'è un errore di sintassi ci sono due istruzioni mySQL a matriosca, select count ( select...
la prima è giusta la seconda mi lascia parecchi dubbi. Prova a levare la seconda select
saluti, Caneblu
[ www.caneblu.com ]
Rispondi