• 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

Sort multidimensional array by column value within a column

WooCommerce: Add/display Product or Variation custom field everywhere

Sort a multidimensional array by integer inside of a string value which is two levels down

PHP date() with timezone?

Refresh specific HTML content that retrieves data from MySQL

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

Getting values for an enum?

PHP, how to convert Int value to Week days

Put content of wordpress page inside div

Detect if PHP session exists

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

Laravel Unknown Column 'updated_at'

Form Validation and Submission to database

Laravel Command Schedule Not Working Properly

Adding reCAPTCHA v2 into my PHP file

About Contact Privacy policy Terms and conditions