• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Dropdown with current value from Mysql

phphtmlmysqldropdown


PHP Snippet 1:

<select name="vendors" id="vendors"  required>
                    
<?php
    include "dbConn.php";  
    $records = mysqli_query($db, "SELECT vendors FROM tools WHERE id=$id UNION SELECT vendoren FROM vendors");  

    while($data = mysqli_fetch_array($records))
    {
        echo "<option value='". $data['vendors'] ."'>" .$data['vendors'] ."</option>";  
    }   
?>  </select>

Related Snippets

How to load Codeigniter 4 lang file into an array variable

Woocommerce redirect after add-to-cart error

PHP echo values of all sub keys [duplicate]

How do I upload a laravel project on cPanel shared hosting?

array_map triple dimensional array [duplicate]

Laravel 8 factory state afterCreating

PHP array sort and remove duplicates by two field values

Unable to guess the mime type as no guessers are available Laravel 5.2

Check if user online laravel

best way to store error messages in Laravel (session or variable)

PHP Fatal error: Class not found - PHPUnit

wordpress : How to specify the cause "This site can’t be reached"

How in Laravel run JavaScript code stored in php variable?

Laravel Unknown Column 'updated_at'

PHP each() function replacement

About Contact Privacy policy Terms and conditions