• 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

Change the alert text on add to cart action without selected variation in Woocommerce

How to upload mpdf file after generating to s3 bucket in php

Sliders in Laravel

Error while importing CSV file in database

How To Access A Column In M-M Relationship Table In Laravel

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

Limit login attempts in Laravel 5.7

how to identify the web server name of remote host

How to install php_imagick on wamp64

How to programmatically find public properties of a class from inside one of it's methods

Prevent blank space in pdf pages (DomPdf)

How to get Laravel's CSRF Token from Another Website?

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

PHP, how to convert Int value to Week days

Nginx RTMP not recording

About Contact Privacy policy Terms and conditions