I'm using ajax to update the database when I drag/drop an element from a nested list. But The query is getting the parameter I pass AS column name.
Code inside my Model:
public static function atualiza_drag($disc, $professor, $old)
{
DB::insert('INSERT INTO disciplina_professor (disciplina_id, professor_id) VALUES (`$disc`, `$professor`)');
DB::delete("DELETE FROM disciplina_professor WHERE professor_id = `$old`");
}
The Error:
local.ERROR: exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column '3' in 'field list'
3 is the ID I got from ajax but instead of using this as parameter it's using as a column name and I cant find out why.