Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to retrieve data from database using select option in laravel

<select class="form-control" name="product_id">
    <option>Select Product</option>
    @foreach ($products as $key => $value)
        <option value="{{ $key }}" {{ ( $key == $selectedID) ? 'selected' : '' }}> 
            {{ $value }} 
        </option>
    @endforeach    
</select>
Comment

PREVIOUS NEXT
Code Example
Php :: Laravel retrieving single record 
Php :: File Reading Modes PHP 
Php :: PHP file reading modes with explaination 
Php :: laravel get average from a column 
Php :: curl in laravel 
Php :: laravel collection keys 
Php :: how to check php version codeigniter 3 
Php :: php filter array contain valu 
Php :: laravel 5.8 cors 
Php :: php array filter 
Php :: validator and custom error laravel 8 
Php :: laravel check if record exists 
Php :: sanctum auth check? 
Php :: Add Empty Cart Button WooCommerce 
Php :: laravel log build 
Php :: cloudinary laravel 
Php :: base64 enocode php 
Php :: wp_create_user 
Php :: cannot use font awesome in php mvc 
Php :: laravel handle queryexception 
Php :: prettier with php 
Php :: print variable php 
Php :: laravel throw function 
Php :: curl get response headers php 
Php :: wp_enqueue_script 
Php :: Notice: Undefined variable: _SESSION in C:xampphtdocspracticeheader.php on line 7 
Php :: laravel set session timeout 
Php :: laravel 8 foreign key 
Php :: Get only time from timestamp in laravel 
Php :: laravel required_if 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =