Forums

comparation array

jhaviro 14 Dec, 2015
Hello and happy hollidays

I have this code for conditions:

<?php
$user = JFactory::getUser();
if (in_array( 8, $user->get('groups') ) ) {
 	 return array();
	}else if (in_array( 12, $user->get('groups') ) ) {
			return array(
			'orders.id_traductor' => $user->id,
			'orders.docman_category_id' => 5,
			'orders.enabled' => 1
			);
	}
	
?>

but data inside 'orders.id_traductor' DB is one array (have saved for example: 123,22,345 string)
¿how build comparation 'id' if data is string-Array?

thx!!!
javierp
GreyHead 14 Dec, 2015
1 Likes
Hi javierp,

You can try 'orders.id_traductor LIKE ' => '%'.$user->id.'%',

Bob
jhaviro 14 Dec, 2015
thanks for the reply so quickly!!!!!!!!!
testing.

First I have to fix a problem that I've seen, that has nothing to do with the question, but that affects the result,.

Thank you again.
jhaviro 14 Dec, 2015
Working!! Great!!
Thank you very much

javierp.
A greeting! 😀
This topic is locked and no more replies can be posted.