Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/06/2011, 19:39
Avatar de chevyon
chevyon
 
Fecha de Ingreso: mayo-2008
Mensajes: 5
Antigüedad: 16 años
Puntos: 0
Error de sintaxis en mysql (migración de hosting a server local))

Hola amigos gusto de saludarles nuevamente, quisiera un poco de apoyo. Verán tengo la necesidad de migrar el Sugarcrm de un hosting a modo local. el ambiente es Windows Sever 2008, actualmente estoy utilizando xampp para levantar el server local


Características modo local

###### Apache Friends XAMPP (Basis Package) version 1.7.3 ######

+ Apache 2.2.14 (IPV6 enabled)
+ MySQL 5.1.41 (Community Server) with PBXT engine 1.0.09-rc
+ PHP 5.3.1 (PEAR, Mail_Mime, MDB2, Zend)
+ Perl 5.10.1 (Bundle::Apache2, Apache2::Request, Bundle::Apache::ASP, Bundle::Email, Bundle:BD::mysql, DBD::SQlite, Randy Kobes PPM)
+ XAMPP Control Version 2.5.8 (ApacheFriends Edition)
+ XAMPP CLI Bundle 1.6
+ XAMPP Port Check 1.5
+ XAMPP Security 1.1
+ SQLite 2.8.17
+ SQLite 3.6.20
+ OpenSSL 0.9.8l
+ phpMyAdmin 3.2.4
+ ADOdb v5.10
+ FPDF v1.6
+ Zend Framework 1.9.6 Minimal Package (via PEAR)
+ Mercury Mail Transport System v4.72
+ msmtp 1.4.19 (a sendmail compatible SMTP client)
+ FileZilla FTP Server 0.9.33
+ Webalizer 2.21-02 (with GeoIP lite)
+ apc 3.1.3p1 for PHP
+ eAccelerator 0.9.6-rc1 for PHP
+ Ming 0.4.3 for PHP
+ PDF with pdflib lite v7.0.4p4 for PHP
+ rar 2.0.0-dev for PHP
+ Xdebug 2.0.6-dev for PHP
+ libapreq2 v2.12 (mod_apreq2) for Apache


Características del hosting:

Apache version 2.2.17
PHP version 5.2.17
MySQL version 5.1.56-community-log
Architecture x86_64
Operating system linux


1er error:
La version de sugarcrm es Versión 5.2.0k se preguntaran porque no se actualiza, el motivo es porque otro persona que le presto servicio a la empresa hizo cambio en el sistema para poder posponer las llamadas como cuando utilizas outlook (posponer 5min, 10min, 1 hora, etc) y es con este modulo con el que tengo el primer problema pues a la hora de seleccionar posponer me muestra el siguiente error

Posponer
Error: 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 '), reminder_time = 60, date_end = DATE_ADD(date_end, INTERV' at line 1


Pego el código

<?php
include('i_entrada.php');
include('common.php');

$alert_tipo = get_param("alert_tipo");
$alert_id = get_param("alert_id");
$alert_pospuesto = get_param("alert_posponer");
$alert_user = get_param("alert_user");
$err = 0;

echo "<h1>Posponer ".$alert_tipo."</h1>";

if (isset($alert_id)) {
$db = conectar();

if ($alert_tipo == "Llamada") {
$sql = "UPDATE calls SET date_start = DATE_ADD(date_start, INTERVAL ".$alert_pospuesto." SECOND),
reminder_time = '60',
date_end = DATE_ADD(date_end, INTERVAL ".$alert_pospuesto." SECOND)
WHERE id = '".$alert_id."' AND assigned_user_id = '".$alert_user."'" ;

} else {
$sql = "UPDATE meetings SET date_start = DATE_ADD(date_start, INTERVAL ".$alert_pospuesto." SECOND),
reminder_time = 60,
date_end = DATE_ADD(date_end, INTERVAL ".$alert_pospuesto." SECOND)
WHERE id = '".$alert_id."' AND assigned_user_id = '".$alert_user."'" ;

};

if (!mysql_query($sql,$db)) {
die('Error: ' . mysql_error());
};
echo "<h3>Su ".$alert_tipo ." fue pospuesta satisfactoriamente!</h3>";
}
?>


tambien probe con Zend server pensando que era la versión de php y estoy utilizando la misma que el proveedor de hosting 5.2.17 pero aun continuo con el problema de sintaxis quisiera saber si alguien puede ayudarme con el codigo. lo que si pude visualizar es que la version de MYSQL varia en las 3 aplicaciones


Servidor web

cpsrvd 11.28.64
Versión del cliente: 5.1.56
extensión PHP: mysql

Xampp
+ MySQL 5.1.41 (Community Server) with PBXT engine 1.0.09-rc

Zend Server
Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
Versión del cliente: 5.1.35
extensión PHP: mysqli

Saludos