• 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

Adding multiple items to WooCommerce cart at once

How to redirect to another page and call a Function there on Angular ng-click

PHP drop down list using array's and foreach (else and for) code

Mysqli Output to a table

if statement inside concatenation

Execute only one time and then wait set period of time before executing again

PHP function Not Working As Expected From functions.php Include File

Access denied for user 'homestead'@'localhost' (using password: YES)

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

Laravel Unknown Column 'updated_at'

Issue saving card for customer

Nginx disallowing execution of PHP in uploads directory with Magento

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

How to install php yaml on CentOs?

Getting error: CodeIgniterDatabaseBaseResult::getResult in CodeIgniter

About Contact Privacy policy Terms and conditions