Jump to content

counter = column + 1, dosent work


Nati323
 Share

Recommended Posts

hey, i have this query :

INSERT INTO recepts (for_who, dat, items, checks, cash, mam, sum_before, sum_after, recept_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?,(recepts.recept_id + 1))

and i execute her, but the column recept_id dosent updated to +1, its always have value 1.

i have an update query with the same idea (column +1) and its work fine, i dont know why this query dosent work..

help please :fool:

 

the recept_id is not the id column

 

EDIT: I fix it with "INSET INTO SELECT", I think its not possible to do what i want in the first query , because the db dosent know which column to select from the all records...

Edited by Nati323
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...