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 local 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:
The table creation script is the following:
$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'";
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,
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!
By the way, I'm using PHP 5.2.3