Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increment without autoincrement?

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Good morning,

I would be very pleased if someone could teach me the way
to increment the values of different fields of the same table in a single row with a "simple" mysql function.
Thus, the table would always have one row with the numeric values updated in it.
Also, I would like to do that without having to retrieve the values from the table before.

Thanks a lot to the one who will answer.



 
Hello,

In fact I've found the solution.
Here it is:
$sql = "UPDATE table SET value = value + 1 WHERE ID = 1";

Soooo easy..... sorry for having bothered.....:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top