• 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 solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

definer/invoker of view lack rights to use them

Spam Filter in Contact Form

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

PHP error: "The zip extension and unzip command are both missing, skipping."

Search for array row with specific column value and return another value from qualifying row

Yii2 select2 database exception number of bound variables does not match number of tokens

Apply session id from request header

How Can I Do LIMIT 1, 2 In WP_Query

xdebug 3 not working in ubuntu 20.04 with docker

Yii2 redirecting to previous page after login

Manage independently the decimal number of the price of each product [duplicate]

How to add a sidebar to Woocommerce Shop Page?

Make survey at laravel 5.4 and MySQL

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

About Contact Privacy policy Terms and conditions