Reset
Search Employees Across Multiple Columns
Program Info
Program Code
×

Search Employees Across Multiple Columns

This query finds employees where the word "india" appears in the address, name, or email field.

Footer

×

Search Employees Across Multiple Columns

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Query_Controller extends Controller
{
    public function index()
    {
        $data = DB::table('employee')->whereAny(['address','name','email'],'like','%india%')->get();
        echo "<pre>";
        print_r($data->toArray());
    }
}

Footer

Search Multiple Columns with LIKE
Program Info
Program Code
×

Search Multiple Columns with LIKE

This query searches for "india" in the address, name, or email columns and returns all matching employee records.

Footer

×

Search Multiple Columns with LIKE

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Query_Controller extends Controller
{
    public function index()
    {
        $data = DB::table('employee')->whereAll(['address','name','email'],'like','%india%')->get();
        echo "<pre>";
        print_r($data->toArray());
    }
}

Footer

Skip First 5 Records and Get Next 10 Records
Program Info
Program Code
×

Skip First 5 Records and Get Next 10 Records

This query skips the first 5 records and fetches the next 10 records from the employee table.

Footer

×

Skip First 5 Records and Get Next 10 Records

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Query_Controller extends Controller
{
    public function index()
    {
        $data = DB::table('employee')->skip(5)->take(10)->get();
        echo "<pre>";
        print_r($data->toArray());
    }
}

Footer

Update Employee Details
Program Info
Program Code
×

Update Employee Details

Updates the name and address of the employee whose id is 92558.

Footer

×

Update Employee Details

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Query_Controller extends Controller
{
    public function index()
    {
        DB::table('employee')->where('id',92558)->update(['name'=> 'kishna verma','address'=>'meerut']);  
    }
}

Footer

Update Employee Name by Employee ID
Program Info
Program Code
×

Update Employee Name by Employee ID

This query finds an employee by their employee ID and updates the employee's name.

Footer

×

Update Employee Name by Employee ID

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Query_Controller extends Controller
{
    public function index()
    {
        DB::table('employee')->where('id',92558)->update(['name'=> 'kishna verma']); 
    }
}

Footer

Update Employee Record by Employee ID
Program Info
Program Code
×

Update Employee Record by Employee ID

This query updates the employee's name, email, and address for the employee with ID 39418.

Footer

×

Update Employee Record by Employee ID

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Query_Controller extends Controller
{
    public function index()
    {
        $data['name'] = 'krishna verma';
        $data['email'] = 'krishna@gmail.com';
        $data['address'] = 'meerut';
        DB::table('employee')->where('id',39418)->update($data);    
    }
}

Footer

Update Employee Record by ID
Program Info
Program Code
×

Update Employee Record by ID

This query updates the name and address of the employee whose id is 95299.

Footer

×

Update Employee Record by ID

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class Query_Controller extends Controller
{
    public function index()
    {
        $data = [
            'name'=> 'krishna verma',
            'address'=> 'meerut',
        ];
        DB::table('employee')->where('id',95299)->update($data);   
    }
}

Footer

Showing page  8  of  8  (Total  77 records)
« Prev  1 ... 6  7  8 
×
Name : Krishna Verma    |    Father's Name : Mr. Satish Kumar    |    Email ID : krishnaverma28081997@gmail.com    |    Religion : Hindu    |    Address : Dayampur, kanker khera, Meerut Cantt (250001), UP    |    Date of Birth : 28 August 1997    |    Marital Status : Non-Married    |    Place of Birth : Dayampur Kanker Khera Meerut Cantt.    |    Gender : Male    |    Age : 28    |    Contact : 9520335394    |    Father's Occupation : Sports man    |    Mother's Name : Smt. Kuntesh Devi    |    Mother's Occupation : Homemaker    |    Number of Brothers : 1    |    Number of Sisters : 1    |    Current Residence : Dayampur kanker khera meerut cantt    |    Family Type : Nuclear Family    |    Family Name : verma    |    Height : 5' 6"    |    Weight : 70 kg    |    Complexion : Fair    |    Body Type : Athletic    |    Hair Color : Black    |    Health Status : Good    |    Any Physical Disability : No    |    Highest Qualification : B.Tech (CSE)    |    Master Skill : PHP Laravel    |    Total Projects : 40 +    |    Total Skills : 25 +    |    Languages Known : Hindi and English    |    Website : krishnaportfolio.in    |    Siblings : 3    |    Nationality : Indian    |    Total Experience : 5 Years    |    LinkedIn : https://www.linkedin.com/in/krishna-verma-840b71356/    |    Total Programs : 10000    |    Total Projects : 40    |    Total Skills : 25    |    Total Experience : 5    |    Total DSA Problems : 200    |    Total Served Companies : 2    |    Leetcode : https://leetcode.com/u/krishnavermadeveloper/    |    Naukri : https://www.naukri.com/mnjuser/profile?id=&altresid