• 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

Custom post type single page not working

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

CSV to PHP class properties

What is my SQL missing?

Filter WooCommerce products with post__in and additional meta queries

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

Update Total in checkout of Woocommerce with Ajax Request

wordpress function breaks wp-admin

Warning: sqlite_query() expects parameter 1 to be resource, string given

Redirect to previous page with php

Facebook API, get page post link (PHP)

PHP array stringify

How to Install Composer Require doctrine/dbal

how to loop through json response data using ajax jquery?

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

About Contact Privacy policy Terms and conditions