Errore nella query

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

Moderatore: mod Generali

Rispondi
linda74
membro Regular
membro Regular
Messaggi: 160
Iscritto il: 11/08/2005, 13:38
Località: Rimini

Errore nella query

Messaggio da linda74 »

Ciao a tutti..

cancellando ordini dal pannello di amministrazione del mio shop, mi si è presentato 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 '-10, 10' at line 1

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '4' and s.orders_status_id = '6' and ot.class = 'ot_total' order by o.orders_id DESC limit -10, 10

Come posso risolvere ?

Grazie1000.

Linda.
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Re: Errore nella query

Messaggio da marcus »

linda74 ha scritto:Ciao a tutti..

cancellando ordini dal pannello di amministrazione del mio shop, mi si è presentato 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 '-10, 10' at line 1

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '4' and s.orders_status_id = '6' and ot.class = 'ot_total' order by o.orders_id DESC limit -10, 10

Come posso risolvere ?

Grazie1000.

Linda.
Leggi qui:

viewtopic.php?t=2943

Saluti
Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
linda74
membro Regular
membro Regular
Messaggi: 160
Iscritto il: 11/08/2005, 13:38
Località: Rimini

Messaggio da linda74 »

Grazie Marcus per la risposta.

Il mio file amin/includes/classes/split_page_results.php è un pò diverso:

riga 37
$offset = ($max_rows_per_page * ($current_page_number - 1));
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

Come devo modificarlo ?

Ciao e Grazie.

Linda.
linda74
membro Regular
membro Regular
Messaggi: 160
Iscritto il: 11/08/2005, 13:38
Località: Rimini

Messaggio da linda74 »

Risolto quasi tutto ....

Ho applicato i fix

Codice: Seleziona tutto

Line 67 in catalog/includes/classes/split_page_results.php must be changed from:

$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

to:

$this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;

Line 38 in catalog/admin/includes/classes/split_page_results.php must be changed from:

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

to:

$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;
L'unico problema è che non arrivano più le email ordini ....
:roll:

Ciao.

Linda.
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Messaggio da marcus »

linda74 ha scritto:
L'unico problema è che non arrivano più le email ordini ....
:roll:

Ciao.

Linda.
Qualunque sia la causa del problema non è da ricercare nel fix di cui sopra che, se correttamente applicato, non ha alcuna influenza sulla funzione di invio delle email ordini.

Naturalmente ciò vale per la versione pulita di osC 2.2MS2.

Saluti
Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
Rispondi