Hi @ all,
I am wondering why I can not fetch data from the database with using DataObject::get_one.
I am trying something like this:
$code = 'BE_0007';
$val = DataObject::get_one('Profession', 'Profession_ID = "'.$code.'"');
I get this Error:
Couldn't run query: SELECT "Profession"."ClassName", "Profession"."Created", "Profession"."LastEdited", "Profession"."Profession_ID", "Profession"."Title", "Profession"."Description", "Profession"."ID", CASE WHEN "Profession"."ClassName" IS NOT NULL THEN "Profession"."ClassName" ELSE 'Profession' END AS "RecordClassName" FROM "Profession" WHERE (Profession_ID = "BE_0007") LIMIT 1 Unknown column 'BE_0007' in 'where clause'
When I am trying to fetch the data with DataObject::get_by_id, I don't have a problem to get it.
$id= 7;
$val = DataObject::get_by_id('Profession', $id);
Anybody out there who knows what I am doing wrong?
Thank you for your help!