Forums

How do use WHERE LIKE %...% with field value?

CyborgPrime 11 Dec, 2016
I have a field containing a name called selected_name.
I want to return all records WHERE the name is LIKE selected_name

I know that I'm on the right track with this example:

<?php
return array( 'model_id.column LIKE' => '%value%' );
?>


How do i get:
$form->data['selected_name'].

into the value spot? I guess I dont understand the syntax
CyborgPrime 11 Dec, 2016
Answer
Figured it out

"%".$form->data['selected_name']."%"
GreyHead 11 Dec, 2016
Hi CyborgPrime,

I updated the FAQ to include a second example.

Bob
This topic is locked and no more replies can be posted.