Replies: 1
Hi,
First of all thanks for this amazing plugin! 🙂
I have one problem… i have table of different school classes, each with one or more teachers, and need to do list for logged single teacher.
I’m using something like this (separation to 2 variables is intentional for something else in the code)
$params_where = "where con_user.id = ".get_current_user_id();
$params = array(
'where' => $params_where,
);
$classes = pods( 'class', $params);
But keep getting this error:
Database Error; SQL: SELECT DISTINCT
t.* FROMwp_pods_classAStLEFT JOINwp_podsrelASrel_con_userONrel_con_user.field_id= 32 ANDrel_con_user.item_id=t.idLEFT JOINwp_usersAScon_userONcon_user.ID=rel_con_user.related_item_idLEFT JOINwp_podsrelASrel_con_work_placesONrel_con_work_places.field_id= 117 ANDrel_con_work_places.item_id=t.idLEFT JOINwp_pods_work_placesAScon_work_placesONcon_work_places.id=rel_con_work_places.related_item_idWHERE ( wherecon_user.id= 2 ) ORDER BYcon_work_places.nameASC, t.name ASC,t.name,t.idLIMIT 0, 15; Response: 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 ‘wherecon_user.id= 2 ) OR’ at line 22