Greg McNulty
Greg McNulty

Reputation: 1466

How do I modify a row with an auto increment field?

Why is this creating a new row at the bottom with this data instead of modifying that specified row?

$sql = "
UPDATE products SET
    productName = '$pname', 
    productDescription = '$pdes'
WHERE pID = '$pidmod'
";

WHERE pID='$pidmod' is the auto increment field.

Upvotes: 0

Views: 34

Answers (1)

ypercubeᵀᴹ
ypercubeᵀᴹ

Reputation: 115520

An UPDATE statement does not add rows - unless there are triggers involved.

Upvotes: 3

Related Questions