Fix bug in new_member()

This commit is contained in:
Ceda EI 2018-05-17 15:13:18 +05:30
parent f27718a5d8
commit 2c196ab7de
1 changed files with 1 additions and 1 deletions

View File

@ -43,6 +43,7 @@ function send_html($post_message, $reply=false) {
function new_member() {
global $decoded;
$mysql = require('mysql_credentials.php');
$conn = new mysqli($mysql['servername'], $mysql['username'], $mysql['password'], $mysql['database']);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
@ -54,7 +55,6 @@ function new_member() {
$username = $member->{"username"};
$user_id = $member->{"id"};
$query = "INSERT INTO users (user_id, username, follows) values($user_id, '$username', -1);";
$mysql = require('mysql_credentials.php');
$conn->query($query);
$lastmember = include('lastmember.php');
$text = "Welcome @$username,\n";