• 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

Transpose and flatten multiple rows of array data [duplicate]

PHP Array split string and Integers

Laravel Schedule not sending email

Alert message after submitting form in PHP

PHP header location absolute URL

Symfony process run throws exception - executing on command line works

Inserting Country Selection into MySQL PHP [duplicate]

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Symfony there are no commands defined in the "make" namespace

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

PHP SoapClient: set a namespace without prefix

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

Convert regular text to array using notepad++

Populate Dynamic Dropdowns List in Codeigniter

PHPUnit (Phar) Fatal Error Only When Test Fails

About Contact Privacy policy Terms and conditions