• 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

Dynamic dropdown Ajax PHP request

Lexik JWT authentication problem "Invalid credentials"

Symfony process run throws exception - executing on command line works

How to test a php login connected to a mysql db through xampp?

Set quantity minimum, maximum and step at product level in Woocommerce

Laravel: Why is my variable not being set while it's in the construct function of the controller?

How to modify CSS in a specific page of the WP admin dashboard (backend)

Wordpress add responsive srcset header image to theme

How to change HTML structure inside WP <head>

How to identify whether webp image is static or animated?

Fatal error: [] operator not supported for strings

Upload a file Using PHP and JavaScript

Post Form Data To phpmyadmin Database

jQuery Ajax Post with data

Not able to access model in the controller mautic

About Contact Privacy policy Terms and conditions