I have the following code:
$sql='ALTER TABLE tributos_prod AUTO_INCREMENT=:ultimo_id';
try {
$query_delete=$conecta->prepare($sql);
$query_delete->bindValue('ultimo_id', $ultimo_idTP+1, PDO: : PARAM_STR);
$query_delete->execute();
}
catch(PDOException $erro) {
echo'[ERRO] ao atualizar AUTO-INCREMENTO: '.$erro->getMessage();
exit;
}
The following error is displayed:
SQLSTATE [42000]: Syntax error or access violation: 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 '' 13 '' at line 1
I already checked the value of the variable $ultimo_idTP
, I used intval()
and it's alright, but I'm not able to identify the problem.