Pagina 1 di 1

Errore nella query

Inviato: 19/02/2007, 18:09
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.

Re: Errore nella query

Inviato: 20/02/2007, 22:16
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

Inviato: 21/02/2007, 9:30
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.

Inviato: 21/02/2007, 11:05
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.

Inviato: 21/02/2007, 20:34
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