I have a table called dircode
:
CREATE TABLE dircode (
jobcodeid int(11) NOT NULL AUTO_INCREMENT,
jobcodeserial varchar(255) NOT NULL,
jobcode1 varchar(255) NOT NULL,
codestatus1 varchar(60) NOT NULL,
jobcode2 varchar(255) NOT NULL,
codestatus2 varchar(60) NOT NULL,
jobcode3 varchar(255) NOT NULL,
codestatus3 varchar(60) NOT NULL,
jobcode4 varchar(255) NOT NULL,
codestatus4 varchar(60) NOT NULL,
PRIMARY KEY (jobcodeid)
)
A user may have upto 4 job codes for single serial number.
When a user inputs a dir serial number and one code, I want that particular job's codestatus
to be updated to 'Used'
. The rest of the data should remain intact.
For example, when a user enters a serial number and jobcode3
the status of codestatus3
should get updated to 'Used'
.
Please help me in writing PHP code for the above query.