Posts

laravel - order query

    $data = Order :: query ()             -> where ( 'employeeid' , 'LIKE' , "%{ $employeeid }%" )               -> orderBy ( 'id' , 'DESC' )             -> paginate ( 25 );

laravel where and orwhere query with pagination

    public function SupplierProductReturnSearch ( Request $request ){         // Get the search value from the request         $search = $request -> input ( 'search' );                   // Search in the title and body columns from the posts table         $listings = MainProduct :: query ()             -> where ( 'name' , 'LIKE' , "%{ $search }%" )                       -> orWhere ( 'product_id' , 'LIKE' , "%{ $search }%" )                       -> paginate ( 25 );             // Return the search view with the resluts compacted         return view ( 'front.manager.return-supplier-product' , compact ( 'listings' ));     }

other table connect

        // Load database   $db2 = $this -> load -> database ( 'database2' , TRUE );   // Select records from 2nd database   $db2 -> select ( '*' );   $db2 -> where ( 'id' , $business_id ); $query = $db2 -> get ( 'cld_businesses' );   $bussinessData = $query -> first_row ();

order by and order type

   $this->data['rows'] = $this->batch_model->get_rows(array("table" => "result_control", "limit" => $limit, "offset" => $offset,"order_by"=>"id", "order_type"=>"desc"), array());

number validation by codeiginter form

< div class = "col-sm-3" >     < div >         < label for = "phone_no" class = "control-label" > Contact No. < span class = "text-danger" > * </ span ></ label >         < input type = "number" minlength = "11" maxlength = "11" required id = "phone_no"             value = " <?php echo set_value ( 'phone_no' ); ? > " class = "form-control" name = "phone_no"             placeholder = "Enter Contact No." oninput = " validity . valid || ( value = ''); " />         <?php echo form_error ( 'phone_no' ); ? >     </ div > </ div > <?php $this -> form_validation -> set_error_delimiters ( '<div class="errorValid">' , '</div>' ); $this -> form_validation -> set_rules ( 'phone_no' , 'Contact No ...

mulitple where query codeiginter

      $query = $this -> $db -> select ( '*' ) -> where ([ 'b_cat_id' => $b_cat_id , 'b_s_cat_id' => $b_s_cat_id ]) -> get ( 'web_about' ) -> result ();

add filed in table and delete ospecific field

 ALTER TABLE `company_info` ADD `mail_welcome_template` VARCHAR(255) NULL AFTER `payment_option`;