From: Marcos G. T. <ad...@gm...> - 2013-10-05 21:32:27
|
I don't know which version you have, but the last in the sourceforge, the file includes/FreightCalculation.inc has the ofender code: =========== CODE ================== // if there is some details of the address besides the country $sql .= " AND ("; if ($BrAddCountry != $CountriesArray[$_SESSION['CountryOfOperation']]){ /* For international shipments empty destination (ANY) is allowed */ $sql = $sql . " destination = '' OR"; } $sql = mb_substr($sql, 0, strrpos($sql,' OR')) . ')'; } $CalcFreightCostResult = DB_query($sql,$db); =========== \CODE =============== I guess a quick solution (but not the definitive) was to replace this part by: // if there is some details of the address besides the country $sql .= " AND ("; $OR=""; foreach ($FindCity as $City) { $sql = $sql . $OR ." destination LIKE '" . ucwords($City) . "%'"; $OR= " OR"; } if ($BrAddCountry != $CountriesArray[$_SESSION['CountryOfOperation']]){ /* For international shipments empty destination (ANY) is allowed */ $sql = $sql . $OR. " destination = ''"; } // $sql = mb_substr($sql, 0, strrpos($sql,' OR')) . ')'; $sql .=")"; } $CalcFreightCostResult = DB_query($sql,$db); ================= /code ============= This form avoids the las " OR" in the sql 2013/10/5 Rafael Chacón <raf...@gm...> > Hi, > > Someone has an idea of where to look for to correct this problem? > > > on: http://www..../weberp/DeliveryDetails.php?identifier=1380990638 > > > Error de Base de Datos 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 ')' at line 10 > > Fallo de SQL : El SQL que falló fue > SELECT shipperid, kgrate * 4 AS kgcost, cubrate * 0 AS cubcost, > fixedprice, minimumchg FROM freightcosts WHERE locationfrom = 'CURRI' AND > destinationcountry = 'Costa Rica' AND maxkgs > 4 AND maxcub >0 AND ( > destination LIKE '400m%' OR destination LIKE 'Oeste%' OR destination LIKE > 'Y%' OR destination LIKE '400m%' OR destination LIKE 'Norte%' OR > destination LIKE 'Urbanización%' OR destination LIKE 'La%' OR destination > LIKE 'Favorita%' OR destination LIKE 'San%' OR destination LIKE 'José,%' OR > destination LIKE 'San%' OR destination LIKE 'José,%' OR destination LIKE > 'Pavas%' OR destination LIKE '10109%' OR destination = '' OR) > > Regards, Rafael. > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > > -- Ing Marcos R Garcia Trejo (52) 9991-513412 Laboratorio de Ingeniería y Procesos Costeros (LIPC) Unidad Académica Sisal, UNAM MGa...@ii... Tel 52 988 931 1000 |