Skip to main content
Topic: field  (Read 1206 times) previous topic - next topic

field

   
Hi, how can I do to create a field that is self-increasing?
concatenating three fields and the increase depends on one of them
example I will create a student code which is composed of school code, grade and course
 the fields   code:5000 grade:08 course:1 
student code:500008101,
that the last two digits increase as a new student is ingested always and when they are of the same course

And a question how can I implement a calendar on my site

 

Re: field

Reply #1
@HENRYPIERCE‍ you have to create a database table column to store the two-digit, then during add(insert) you will create an incremental variable in a for loop that you check against the column in the database if it exists. if it exists, then it increments the variable until it gets a number that does not exist then you insert it.
As for how to implement a calendar, you can follow this tutorial.