It is posible use sql to read data by criteria like WHERE statement in version4
Hi azz13,
Please see this FAQ I think that the Conditions Box in the DB Read action uses the same syntax.
Bob
Please see this FAQ I think that the Conditions Box in the DB Read action uses the same syntax.
Bob
I use this sintax building WHERE statement
<?php
return array("model.field LIKE" => "%value%");
?>
If i write specific value all works great, but if I try read value from form this not work
<?php
return array("model.field LIKE" => "%value%");
?>
If i write specific value all works great, but if I try read value from form this not work
Hi
I try explain.
I have table with two columns "name" "groups".
For example record Mike group1,group4
Want to create form to filter group users. Create form with combobox with groups and submit button. Add "DB read" action to summit and add condition:
<?php return array('details.user_groups LIKE' => '%echo $form->data['search_group']%'); ?>
where user_groups is table field and search_group form field name. I see all results in table.
If i use
<?php return array('details.user_groups LIKE' => '%group3%'); ?>
all works great.
I use $form->data['search_group'] in custom code and all work great.
what am I doing wrong?
I try explain.
I have table with two columns "name" "groups".
For example record Mike group1,group4
Want to create form to filter group users. Create form with combobox with groups and submit button. Add "DB read" action to summit and add condition:
<?php return array('details.user_groups LIKE' => '%echo $form->data['search_group']%'); ?>
where user_groups is table field and search_group form field name. I see all results in table.
If i use
<?php return array('details.user_groups LIKE' => '%group3%'); ?>
all works great.
I use $form->data['search_group'] in custom code and all work great.
what am I doing wrong?
Hi azz13,
You've got some serious problems with your PHP. This may work better:
Bob
You've got some serious problems with your PHP. This may work better:
<?php
return array('details.user_groups LIKE' => "%{$form->data['search_group']}%");
?>
Bob
This topic is locked and no more replies can be posted.