• 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 solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

Laravel print last executed SQL query with Query log

How to change the app environment at run time?

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

How do I remove this delivery notification from here?

How to retrieve Active Directory group policy maximum password age using LDAP

Lexik JWT authentication problem "Invalid credentials"

Laravel Nova, route not found

How to create laravel storage symbolic link for production or sub domain system?

Laravel Database Strict Mode

Sum array values

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

PHP date() with timezone?

Error converting docx to pdf using Unoconv

GRPC installed successfully on ubuntu but php is looking for it in another folder

About Contact Privacy policy Terms and conditions