• 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 do I remove this delivery notification from here?

Malformed MIME header error in Symfony 5.3

Check if string contains a value in array [duplicate]

Laravel multi auth - Authentication user provider [] is not defined

Update Total in checkout of Woocommerce with Ajax Request

browsersync doesn't work with XAMPP

How to retrieve Active Directory group policy maximum password age using LDAP

How to find phpcs current default standard

PHP/HTML: Creating A SubMenu

How to unlink image from folder?

Lumen - Postgresql setup - Composer

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

Jquery DataTables: Data not displaying in table via Ajax

PHP Fatal error: Class not found - PHPUnit

Select option from dropdown menu with PHP and mySql

About Contact Privacy policy Terms and conditions