• 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

Having trouble with PDO queries (Notice: Undefined index)

Filter WooCommerce related products by Polylang language

Laravel Database Strict Mode

I want to store data in new index as per my key in php [duplicate]

Open a popup box after receiving result from ajax

possible options to create pdf file using html elements to generate invoice in php and codeigniter

send email using gmail-api and google-api-php-client

How to send parameters in soap request in php in __soapcall() function

Make survey at laravel 5.4 and MySQL

how to upload binary image to sql server using php laravel

PHP to search within txt file and echo the whole line

phpunit - mockbuilder - set mock object internal property

Adding custom body class to the custom archive pages

Google Calendar API batch request PHP

How to make dot match newline characters using regular expressions

About Contact Privacy policy Terms and conditions