Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "0snata";
- $dbname = "auzvono";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Greska: " . $conn->connect_error);
- }
- //
- //$sql = "SELECT profil FROM profil";
- //$result = $conn->query($sql);
- //if ($result->num_rows > 0) {
- //while($row = $result->fetch_assoc()) {
- //if ($row["profil"] == '1'){
- // $query = 'Truncate table profil; INSERT INTO profil (profil) values (0);';
- // $conn->multi_query($query)}
- //if ($row["profil"] == '0'){
- // $query = 'Truncate table profil; INSERT INTO profil (profil) values (1);';
- // $conn->multi_query($query)}
- //}
- //}
- //
- $query = 'RENAME TABLE `prof` TO `profT`; RENAME TABLE `profA` TO `prof`; RENAME TABLE `profT` TO `profA`;';
- if($conn->multi_query($query)) {
- $conn->close();
- return header('Location: index.php');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement