sylvest Posted February 26, 2019 Posted February 26, 2019 In my web application, I am trying to execute the SQL query: SELECT b.BuildNum,c.MenuName FROM `Members$BuildClasses` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = " . $_SESSION['login_memberid'] . " AND b.Status > '0' AND mc.Status > '0' ORDER BY BuildNum by executing the statement: $result = mysqli_query($dbh, $sql); on line 444 in file: /home/sylvest/include/functions.php (where $sql is equal to the above string) When I do this I'm getting this error: [26-Feb-2019 12:40:23.516 GMT 0] on localhost, L_ERROR Failed to query database, \$result is False, SQL = {SELECT b.BuildNum,c.MenuName FROM `Members` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = 4 AND b.Status > '0' AND mc.Status > '0' ORDER BY BuildNum}, Errno: 1054 Error: Unknown column 'mc.BuildClassId' in 'on clause' at line 444 in file: /home/sylvest/include/functions.php Called from checked_query(SELECT b.BuildNum,c.MenuName FROM `Members` AS mc JOIN BuildClasses AS c ON mc.BuildClassId = c.BuildClassId JOIN Builds AS b ON c.BuildClassId = b.BuildClassId WHERE mc.MemberId = 4 AND b.Status > '0' AND mc.Status > '0' ORDER BY BuildNumbuilds that this user may access) at line 254 in file /home/sylvest/include/header.php Called from require(/home/sylvest/include/header.php) at line 65 in file /home/sylvest/public_html/swchoir/welcome.php From this it seems that MySQL is executing the query on the table `Members` instead of `Members$BuildClasses`, which is why it can't find the 'mc.BuildClassId' field. An earlier version of the code DID request the table `Members` but I changed it several days ago. Why is it still using the old version of the code? Is there any caching system in place for this type of code? If so, what exactly is cached, and where? How do I force it to update the cache? Or what other reason might there be for this error? Thanks - Rowan Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.