Hi.
I've my website running on MySQL 4.1.21-community-nt and we're planning a database upgrade to MySQL 5.x, mostly because the stored procedures and triggers features.
However, doing some tests, I found out that there seems to be a problem with MySQL 5.0.x, 5.1.x and 6.x
Basically, I'm trying to execute the following code:
$idtoken=$POST['idtoken'];
$sql="UPDATE TOKEN SET NOMBRE='".$POST['nombre']."', LEYENDA='".$POST['leyenda']."', CONTENIDO='".$POST['contenido']."', AREA=".$POST['area'].", FUENTE='".$POST['fuente']."', AUTOR=".$POST['autor'].", FECHA='".$POST['fecha']."', WIKITOKEN='".$_POST['wiki']."' WHERE IDTOKEN='$idtoken'";
The table creation script is the following:
CREATE TABLE TOKEN (
IDTOKEN INT NOT NULL,
NOMBRE TEXT NULL,
LEYENDA TEXT NULL,
CONTENIDO TEXT NULL,
AREA INT NULL,
FUENTE TEXT NULL DEFAULT NULL,
AUTOR INT NULL,
FECHA DATE NULL DEFAULT NULL,
HITS INT NULL,
WIKITOKEN TEXT NULL,
PRIMARY KEY(IDTOKEN),
INDEX TOKEN_FKIndex1(AREA),
INDEX TOKEN_FKIndex2(AUTOR)
);
I've echoed $idtoken and the variable is showing the expected value.
The thing is that it works on 4.1.x and not on 5.0.x or newer versions.
I read somewhere that starting on MySQL 5.0.x there's a revision of the SQL standard (2003 compliance), but I don't know if this has something to do with this.
Unfortunalety, if I don't solve this problem, we cannot perform our database upgrade, and since on version 6.0 won't work, there may be a long way to go.
Am I having some stupid syntax error? is there a new PHP syntax?, is there some MySQL trick?, please, help!
Thanks.
By the way, I'm using PHP 5.2.3