I have a problem please I need help, is there a way that if I click the lock button the student who doesn't exist on the table vote_logs
will automatic put into the other table which is unvoted_logs(table)
,. For example in the student table there is an idno c120-115
and also it was saved in the table vote_logs
my problem is if the vote is time's up then click the button of lock.php, I want that it will automatic put the student records who did not exist in table vote_logs
to unvoted_logs
. Need some help guys
Here is my lock.php:
<?php
include '../connection/connect.php';
include '../dbcon.php';
$stat='lock';
$sqla = "UPDATE student SET status=?";
$qa = $db->prepare($sqla);
$qa->execute(array($stat));
//here is the part where I want to store the student who didn't exist in vote_logs
$stud = mysql_query(" SELECT st.* FROM student st LEFT JOIN studentvotes sv ON st.idno = sv.idno AND st.syearid = sv.syearid
WHERE sv.idno IS NULL AND st.syearid = '$no' AND user_type='3'") or die(mysql_error());
//should I put insert? don't what's next
Header ('Location:lock_unlock.php');
?>