• 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

protect images from being copied

PHP | "The requested PHP extension bcmath is missing from your system."

How can I make a full text index of the column?

Put content of wordpress page inside div

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

PHP: remove filename from path

Laravel 5 controller sending JSON integer as string

Having issue with matching rows in the database using PDO

How to disable only_full_group_by option in Laravel

Stop caching for PHP 5.5.3 in MAMP

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

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

How to make autocomplete work in foreach php loop? (vscode, intellisense)

Laravel 8 factory state afterCreating

php echo remove slashes from url [duplicate]

About Contact Privacy policy Terms and conditions