• 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 use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

How to get multiple values with same key from an array PHP

How to update array value in Laravel

insert multiple rows in a saveall in cakephp

How to check user Permissions using Custom Middleware in Laravel

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

merge all files in directory to one text file

Correct way to use LIKE '%{$var}%' with prepared statements?

How to show selected value using javascript in laravel

CodeIgniter 3 is generating a session file on each request, why?

Move a child array to parent array and change parent/child name

Unable to guess the mime type as no guessers are available Laravel 5.2

how to youtube api data to print in toolset metabox using a button click before save-post

Reload parent page after submit in iframe

Composer Warning: openssl extension is missing. How to enable in WAMP

About Contact Privacy policy Terms and conditions