diff --git a/server/controllers/itemdetail_query.php b/server/controllers/itemdetail_query.php
index bcc37f1b54d38c0f25b24274df305cc12846c7b2..273cfd436a271e0b9ad098ccafce77f3b327b437 100644
--- a/server/controllers/itemdetail_query.php
+++ b/server/controllers/itemdetail_query.php
@@ -1,4 +1,6 @@
 <?php 
+    require_once "connect_database.php";
+    global $conn; $conn = connect_database();
     if ($_SERVER["REQUEST_METHOD"] == "POST" and $_POST["signal"] == "make-purchase") {
         global $conn;
         $query = "SELECT * FROM `item` WHERE username = (?)