Hola estoy teniendo problemas para poder actualizar la información que contiene una de las tablas de mi base de datos. Quiero poder introducir un comentario pero no sé qué pasa que no me lo inserta:
Using perl Syntax Highlighting
my $conexion = ConectarDBrss->connect();
$conexion->{'mysql_client_found_rows'}=1; #disable
my $palabra = "hello";
my $tabla = "traduc";
my $coment = $ventanaAC->textfieldac->Text();
eval {$conexion->do("UPDATE $tabla SET comentario=$coment WHERE palabra=$palabra")};
if ($@) {
printf("No se ha podido introducir\n")
}
La línea 3 la he incluido por lo que pone en CPAN:
Using text Syntax Highlighting
mysql_client_found_rows
Enables (TRUE value) or disables (FALSE value) the flag CLIENT_FOUND_ROWS while connecting to the MySQL server. This has a somewhat funny effect: Without mysql_client_found_rows, if you perform a query like
UPDATE $table SET id = 1 WHERE id = 1
then the MySQL engine will always return 0, because no rows have changed. With mysql_client_found_rows however, it will return the number of rows that have an id 1, as some people are expecting. (At least for compatibility to other engines.)
He utilizado también esto pero es que no me devuelve ningún error:
Using perl Syntax Highlighting
my $sth = $conexion->prepare("UPDATE $tabla SET comentario=$coment WHERE palabra=$palabra");
$sth->execute();