There could come a time when you want to allow people to login and test an application. Then, you may want the application to go back to an original state. One such method to accomplish this is to drop the database tables which change. Then, create and copy backup tables into the changeable tables. Now, each new user gets a fresh look at the website upon login.
The if statement below checks to see if the session exists. If it does, the tables are dropped and are recreated with new content.
$command = “DROP table tablename_footer” ;
$result = mysqli_query($db, $command);
$command = “CREATE TABLE tablename_footer SELECT * FROM tablename_footer_backup “;
$result = mysqli_query($db, $command);
$command = “DROP table tablename_header” ;
$result = mysqli_query($db, $command);
$command = “CREATE TABLE tablename_header SELECT * FROM tablename_header_backup “;
$result = mysqli_query($db, $command);
}
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton