• 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 create a scheduler application in php

Laravel php artisan serve to mimic HTTPS

Transpose multidimensional array and join values with commas

Currently Using CodeIgniter Framework i have an Error

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

PHP header location absolute URL

How to display MySQL table using php and edit it in a web browser

PHP if in_array() how to get the key as well?

Make survey at laravel 5.4 and MySQL

How to auto populate preferredCountries from intl-tel-input with db output

WAMP Virtual Host not working

Woocommerce Checkout - Add conditional field required if one field is filled

Get data from accuweather api url

Uploading video to Youtube using Youtube Data API V3 and Google API Client PHP -- getting 401 (unauthorized) message

Make Calculator - When Button clicked the No shows in Textbox.

About Contact Privacy policy Terms and conditions