Do you have only one teacher in your system?

|
dev 2022-01-18 03:21:14
But this is the query I used but didn’t show any result
piterden 2022-01-18 03:21:51
dev 2022-01-18 03:14:55
I wrote this query and when I execute it, doesn’t insert anything to the attend table:
$q = INSERT INTO attend SELECT id, fullName, number, ‘absent’, ‘curdate()’
FROM student
WHERE id NOT IN (SELECT stu_id FROM attend WHERE day_date = ‘curdate()’)”;

curdate = the current date because I inserted date with current date and system will take the attendant once every day.

Also cant get for what purpose are you doing it?

piterden 2022-01-18 03:23:15
Relational databases doesn’t work in that way. For most of cases you should remove duplicated data, but not create it
dev 2022-01-18 03:24:36
I have attendenc system. With two table
One will have the name of all the students and the name of the table is studen.
The other is to collect the attendant and the name of table is attend.
When the student sign in he/she will be registered in the attend table with the current date.

Now I am trying to have a query that when I click a button will insert all the students that’s didn’t sign in to attend table as absent students.

dev 2022-01-18 03:26:24
piterden 2022-01-18 03:23:15
Relational databases doesn’t work in that way. For most of cases you should remove duplicated data, but not create it

But I am not very good at sql yet and I am trying.
I think in my attend table I must have only id, attend and date
But I am not good with joining tables + I am creating and downloading xlxs file and the content of the file is from attend

piterden 2022-01-18 03:26:30
dev 2022-01-18 03:24:36
I have attendenc system. With two table
One will have the name of all the students and the name of the table is studen.
The other is to collect the attendant and the name of table is attend.
When the student sign in he/she will be registered in the attend table with the current date.

Now I am trying to have a query that when I click a button will insert all the students that’s didn’t sign in to attend table as absent students.

Sorry, it is hard to understand what do you mean.

dev 2022-01-18 03:27:42
dev 2022-01-17 21:44:18
Hello everyone, I am building attendant system, and I have two tables (students- attend)
So, all the students will be registered in student table let’s say we only have five students as shown in photo.
When the student signed in, he/she will be inserted to attend table as showed in the photo and the word present will be written under attend table head.
But I want when I click a button after the class finish to insert the rest of the student that didn’t sign in in this case (Sara and Zain) to attend table with the word absent. How I can do that.

Thank you

In the photo, I have two tables.
You can see (Sara and Zain) didn’t attend the class. So I want a query to insert Sara and Zain to attend table but attend will be absent for them

piterden 2022-01-18 03:28:00
What does attendenc system mean?
dev 2022-01-18 03:28:14
Sorry attendance **
dev 2022-01-18 03:28:32
My English not very good sorry 😒
piterden 2022-01-18 03:28:55
Use google translate
piterden 2022-01-18 03:29:18
dev 2022-01-18 03:28:14
Sorry attendance **

Attendance of what?

dev 2022-01-18 03:29:24
Students
piterden 2022-01-18 03:29:39
By students
piterden 2022-01-18 03:29:46
Of what?
dev 2022-01-18 03:29:49
Teacher will take the attendance of students every day
piterden 2022-01-18 03:30:39
Do you have only one teacher in your system?
dev 2022-01-18 03:30:44
I am generating qr code for each student. And when the student enter the classroom he/she will scan the code
dev 2022-01-18 03:30:50
piterden 2022-01-18 03:30:39
Do you have only one teacher in your system?

Yes πŸ‘

dev 2022-01-18 03:31:33
The teacher will run the web page and each student will scan their code using this computer. I already finished this part
dev 2022-01-18 03:31:52
So when any student scan the code he will be inserted in attend table
piterden 2022-01-18 03:32:27
Do you have only one lesson in your system?
dev 2022-01-18 03:34:14
piterden 2022-01-18 03:32:27
Do you have only one lesson in your system?

I am applying it only for one lesson and later I will make it for more than one lesson

piterden 2022-01-18 03:41:23
I think your solution is incorrect. There shouldn’t be any qr-codes cause they will only make mark process harder and longer. The optimal hardware solution for that is RFID marks. But anyway how are you going to protect your system of showing a few qr-codes by one student?
piterden 2022-01-18 03:41:49
Database is fully incorrect
dev 2022-01-18 03:43:05
Each student will have only qr code, the number field in student table is for university ID. So each student have to register first meaning, each student have to provide name and university ID.
piterden 2022-01-18 03:43:28
dev 2022-01-18 03:43:05
Each student will have only qr code, the number field in student table is for university ID. So each student have to register first meaning, each student have to provide name and university ID.

Look stop

piterden 2022-01-18 03:44:11
I ask not about it
dev 2022-01-18 03:44:28
And when I decode the qr code I get the student uni ID which is unique
piterden 2022-01-18 03:45:08
Okay I am a student and I wiil give my qr to my friend
piterden 2022-01-18 03:45:43
dev 2022-01-18 03:44:28
And when I decode the qr code I get the student uni ID which is unique

QR-code is just a text which can be read by anyone

dev 2022-01-18 03:47:41
Sure, the idea of the qr code is from my friend, he is a teacher the management office organize a Competition between teachers to give creative solutions, he asked me to do this idea for him
dev 2022-01-18 03:49:25
Even the login detail can be vulnerable to because one student can give it to another friend. But this is not my responsibility. I am only helping by making attendance system using qr code which I achieve but I only have issues with mysql 😒
piterden 2022-01-18 03:53:39
dev 2022-01-18 03:49:25
Even the login detail can be vulnerable to because one student can give it to another friend. But this is not my responsibility. I am only helping by making attendance system using qr code which I achieve but I only have issues with mysql 😒

Why he asked you? He should hire the programmer to do that

dev 2022-01-18 03:54:46
I am php programmer but my background in mysql not perfect and I believe it is obvious from my database table structure 😒
|