Support the ongoing development of Laravel.io →
Requests Input Database
Last updated 2 years ago.
0

You need to take a look at advanced wheres.

This should work.

	$name = T_entity_details::where('Entity_Id','!=',$this->userId)
				->where(function($query)
				    {
					$query->where('First_Name','LIKE','%'.$name.'%')
					            ->orWhere('Last_Name','LIKE','%'.$name.'%')
				    })
				->get(array('Entity_Id'))
				->toArray(); 
Last updated 2 years ago.
0

it gives me error 500...

Last updated 2 years ago.
0

if (Input::has('name')) { $name = Input::get('name');

		$name = T_entity_details::where('First_Name','LIKE','%'.$name.'%')
		->where('Last_Name','LIKE','%'.$name.'%','or')
		->where('Entity_Id','!=',$this->userId)
		->get(array('Entity_Id'))
		->toArray();
		$array1 = [];
		foreach ($name as $value) {
			array_push($array1, $value['Entity_Id']);
		}	
	}else{
		$name = T_entity_details::where('Entity_Id','!=',$this->userId)
		->get(array('Entity_Id'))
		->toArray();
		$array1 = [];
		foreach ($name as $value) {
			array_push($array1, $value['Entity_Id']);
		}	
	}
Last updated 2 years ago.
0

anyone...?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

bolfescu bolfescu Joined 4 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.