I have a piece of mysqli code which I written where it will insert values into the database:
$insertsql = \"
INSERT INTO Teacher
(TeacherId, TeacherForename,
Well you can try this:
First get the total number of rows in the table and increment it by 1 and put that into your new id For example:
$selectUsers = mysql_query ("SELECT * FROM `Teacher`") or die(mysql_error());
$num_rows = mysql_num_rows($selectUsers);
$next_id = $num_rows+1;
$new_id = 'T'.$next_id ;
and after insert it into the table:
...