Update in mysql table in loop [closed]

-1

Hello, I have a mysql table that contains the student's number and class date already registered, and I need to update the "PRESENT" field with "S" or "N". In other words, register the traditional call. Could someone give me a suggestion? I'm using PHP. I have a table that contains the student's number, the date of the class. I've already figured it out. Now I need to scan this table and go picking up for each line if the student was present or not. I'm using a foreach but I can not get the "S" or "N" to update each line

    
asked by anonymous 28.10.2017 / 14:31

1 answer

1
UPDATE aluno SET presente = 'S' WHERE numero = ? AND data = ?

Or else:

UPDATE aluno SET presente = 'N' WHERE numero = ? AND data = ?

No ? you enter the student's number and date.

    
28.10.2017 / 15:01