• 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

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

phpmysqljquery-mobile


PHP Snippet 1:

header('Content-Type: application/json');
echo json_encode($data);

PHP Snippet 2:

$.each(data,function(index,item) 
{
    $('<option>').val(item.id).html(item.job_name).appendTo("#job_id");
});

Related Snippets

how to see if database exists with PDO [duplicate]

How to get AJAX to post on second page?

Dynamic table in HTML using MySQL and php

Populate Dynamic Dropdowns List in Codeigniter

PHP array sort and remove duplicates by two field values

Call to a member function givePermissionTo() on null

PHP 8.1: strftime() is deprecated

Reading input in php from terminal

PHP Fatal error: Class not found - PHPUnit

What is my SQL missing?

MySQL default time format UTC or GMT?

Can we define variables in `.tpl` files?

Select option menu read from database and use it's values

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

Add rows to Single product Additional information table in WooCommerce 3.6

About Contact Privacy policy Terms and conditions