From 2c196ab7dec6b17d8befabad0e07824f7e69f1f7 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Thu, 17 May 2018 15:13:18 +0530 Subject: [PATCH] Fix bug in new_member() --- webhook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webhook.php b/webhook.php index 614c7ef..1ee2dad 100644 --- a/webhook.php +++ b/webhook.php @@ -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";