Hello hello,
Quick question - I can't get my 'group_id' column to work for a where clause for my simple join of two tables (contacts & contacts_groups).
The join is working fine and the JSON returned appears to be correct. I just can't get the ->where statement to accept a value for group_id ? It works fine if I try to filter by columns in the contacts table though.
Any help would be appreciated, I'm new to DT, cheers.
Quick question - I can't get my 'group_id' column to work for a where clause for my simple join of two tables (contacts & contacts_groups).
The join is working fine and the JSON returned appears to be correct. I just can't get the ->where statement to accept a value for group_id ? It works fine if I try to filter by columns in the contacts table though.
Any help would be appreciated, I'm new to DT, cheers.
$editor = Editor::inst( $db, 'contacts', 'contact_id' ) ->fields( Field::inst( 'contact_firstname' ) ->validator( 'Validate::required' ), Field::inst( 'contact_email' ) ->validator( 'Validate::email' ), Field::inst( 'contact_mobile' ) ) ->join( Join::inst( 'contacts_groups', 'array' ) ->join( 'contact_id', 'contact_id' ) ->field( Field::inst( 'group_id' ) ) ); $out = $editor ->where( $key = "group_id", $value = '7', $op = '=' ) ->process($_POST) ->data();