Showing rows only from specific users
Showing rows only from specific users
TMR
Posts: 7Questions: 3Answers: 0
Hi All,
Pulling my hair out over this one 8-) I'm using datatables that are used by a lot of users, I need to only show rows from specific users. So figure I need a WHERE condition:
$editor->where( 'EquipmentCatsCompanyID', '+companyidpassedfromform+' );
I need to get it into here but haven't got a clue where to put it. I've tried all options but they end up with errors:
Editor::inst( $db, 'vehiclecats', 'VehicleCatsID' )// VehicleCatsIDis the primary key
->fields(
Field::inst( 'VehicleCatsCompanyID' ),
Field::inst( 'VehicleCatsName' )->validator( 'Validate::notEmpty' ),
Field::inst( 'VehicleCatsDesc' ),
Field::inst( 'VehicleCatsDateAdded' )
->validator( 'Validate::dateFormat', array(
"empty" => true,
"format" => Format::DATE_ISO_8601,
"message" => "Please enter a date in the format yyyy-mm-dd"
) )
->getFormatter( 'Format::date_sql_to_format', Format::DATE_ISO_8601 )
->setFormatter( 'Format::date_format_to_sql', Format::DATE_ISO_8601 )
)
->process( $_POST )
->json();
Can anyone help please?
This discussion has been closed.
Answers
DUH...!!!
I got it, just in case anyone else needs it, it's even simpler than I'd thought (...bashes head against the wall...) - heres the working example: