Unknown column forum.team_id in on clause là lỗi gì năm 2024

Hi All, I'm facing this issue when attempting to delete a course and would appreciate any tips or suggestions on how to resolve it:

Error reading from database

Debug info: Unknown column 'm.course' in 'where clause' SELECT cm.*, m.id AS modinstance, m.name, 'edwiserform' AS modname FROM mdl_edwiserform m LEFT JOIN mdl_course_modules cm ON cm.instance = m.id AND cm.module = ? WHERE m.course = ? [array ( 0 => '24', 1 => '18', )] Error code: dmlreadexception

Stack trace:

  • line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 5145 of /lib/moodlelib.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 5031 of /lib/moodlelib.php: call to remove_course_contents()
  • line 68 of /course/delete.php: call to delete_course()

Moodle 3.7.1

Don't have Edwiser - WP front end for selling Moodle courses?

See 2 tables involved (jot down the course ID number):

mdl_edwiserform and mdl_course_modules

Might have to use mysql client tool of some short to view those tables for course id number for more info.

'SoS', Ken

Ken, as usual thanks for the pointers. Would a collation mismatch have something to do with it? I shall try fix that before I continue in any case (it's *long* overdue).

My uninformed guess would be that mdl_edwiserform doesn't have a field called course

But you would need to supply more information on how you got to this point. Also Edwiser is not a part of core Moodle and so you are more likely to get help from the people who create it.

The code looks odd as by convention you wouldn't alias a field called mdl_edwiserform with m it would be more common to use something like ef, but again that is guesswork.

Thanks Marcus appreciate the feedback, I've submitted it to to the plugin developers for their feedback too. As for how we got here: trying the delete a course that at some point in time used the RemUI course theme, and then getting the above errors even when changing the course theme to topics.

Hi @James,

This issue occurs when all the files of Edwiser Forms are not installed on your end. If you install all the files of Edwiser forms then it will resolve the issue.

You might have added some activity in the course using Edwiser Forms PRO and then one of the files might be deleted which could have caused the issue.

I'm getting below error message with phbb forums when I view users profils

Code:

SQL Error : 1054 Unknown column 'user_id' in 'where clause'
SELECT id AS user_id, password AS user_password, email AS user_email, u.* FROM jos_users u WHERE username = 'esos07' AND user_id <> -1
Line : 169
File : functions.php

What should I do? Pls help..

Unknown column forum.team_id in on clause là lỗi gì năm 2024

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`this->users_table` . users.id AND sessions.token = $this->users_table . 8a4668b' at line 3

Code:

SELECT users.id AS id, users.name AS name, users.email AS email, users.type AS type FROM (users) INNER JOIN sessions ON sessions.user_id = $this->users_table . users.id AND sessions.token = $this->users_table . 8a4668b91e275e020c54444ae9e5cbbc81fba13a WHERE sessions.token = '8a4668b91e275e020c54444ae9e5cbbc81fba13a'

I can make it work, like this:

Code:

$query = $this->db->select($this->users_table . '.id AS id, ' . $this->users_table . '.name AS name, ' . $this->users_table . '.email AS email, ' . $this->users_table . '.type AS type') ->from($this->users_table) ->join($this->sessions_table, $this->sessions_table . '.user_id = ' . $this->users_table . '.id', 'INNER') ->where($this->sessions_table . '.token', $token) ->get();

But I want to put the where($this->sessions_table . '.token', $token) inside the join clause, because I have another $query like this and works.