Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // new method in the mother class
- static function fetch_me() {
- $conn = new mysqli("host", "root", "1657", "db");
- if ($x = $conn->query("SELECT user_info.profile_pic, user_info.bio, users.email, users.password FROM user_info INNER JOIN users ON user_info.username=users.username WHERE user_info.username='". $_SESSION['username']. "'")) {
- return $row = $x->fetch_assoc();
- }
- }
- // then on the settings page
- $init = new Member();
- $myself = $init::fetch_me();
- @$pass = $_POST['pass'];
- @$email = $_POST['email'];
- if (!empty($pass) && !empty($email)) {
- $init->change_email($myself['password'], $myself['email']);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement