Page 1 sur 1

incrémenter

Posté : 22 mai 2005, 23:09
par ginkobiloba
comment on fait pour incrémenter en SQL ?

UPDATE table SET champ1 = champ1 +'1' WHERE champ2='2' ";

champ1 = champ1 +'1' il doit y avoir une erreur, mais je sais pas où

Posté : 22 mai 2005, 23:33
par albat
Tu manipules des données numériques,
il ne faut donc pas les encadrer par des apostrophes (ni par des guillemets)
$req = "UPDATE table SET champ1 = (champ1 + 1) WHERE champ2 = 2"; 

Posté : 22 mai 2005, 23:52
par ginkobiloba
ha d'accord :o

Posté : 23 mai 2005, 10:43
par albat
Ça marche à présent ?

Si oui... [Résolu] ? ;)

Posté : 23 mai 2005, 11:51
par ginkobiloba
merci ça marche :)