if ($googleid) { $sth->bindValue("googleid", $googleid); } try { $sth->execute(); } catch (Exception $e) { echo $e->getMessage(); } $res = $sth->fetchAll(PDO::FETCH_ASSOC); if (count($res)) { if ($fbid) { $uid = $fbid; } elseif ($googleid) { $uid = $googleid; } $data = GeneralFunctions::fbsignin($uid, $email); $success = "1"; $msg = "Login Successful"; } else { $code = md5($email . rand(1, 9999999)); $sql = "insert into users values(DEFAULT,:fbid,:googleid,:name,:email,:token,NOW(),:password)"; $sth = $conn->prepare($sql); if ($fbid) { $sth->bindValue("fbid", $fbid); } else { $sth->bindValue("fbid", ""); } if ($googleid) { $sth->bindValue("googleid", $googleid); } else { $sth->bindValue("googleid", "");