• 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 can I make a full text index of the column?

how to hide previous markers when new markers added in google map javascript api

Star rating with half star support

PHP: Telegram Bot: Insert line break to text message

file_put_content...fail to open stream:Permission denied in Laravel 5

yii2 and mssql insert varbinary into model

Handle error for duplicate entries - PHP/MySQL

Merge column values from two arrays to form an indexed array of associative arrays

how to see if database exists with PDO [duplicate]

PHP array stringify

Batch request Google Calendar php API

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

Laravel get user data with profile

Clients authentication and user authentication with laravel

how to get value from array in laravel

About Contact Privacy policy Terms and conditions