php - How can I autosave data's from other table -


i have problem please need help, there way if click lock button student doesn't exist on table vote_logs automatic put other table unvoted_logs(table),. example in student table there idno c120-115 , saved in table vote_logs problem if vote time's click button of lock.php, want automatic put student records did not exist in table vote_logs unvoted_logs. need guys

sample of data structure

here 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 part want store student didn't exist in vote_logs $stud = mysql_query(" select st.* student st left  join studentvotes sv on st.idno = sv.idno , st.syearid = sv.syearid sv.idno null , st.syearid = '$no' , user_type='3'") or die(mysql_error());  //should put insert? don't what's next  header ('location:lock_unlock.php'); ?> 

i believe use of triggers best solution problem. please read post.

using mysql triggers log table changes secondary table

i'm putting link because there many examples of how make internet registration logs triggers.


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -