• 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

PHP Include for HTML?

How to make a array inside array?

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

How to submit the custom form data in database in WordPress without plugin using ajax?

WooCommerce - unset "<product> removed notice…" on cart page

PHP usort() order in case of equality

Laravel passport auth token not working after moving to different server

send email using gmail-api and google-api-php-client

How to keep value of selected value after form submission?

How to insert Google Adsense Code in PHP script?

How can I make a full text index of the column?

Add customer email and phone in "Order" column to admin orders list on Woocommerce

PHP Download MP3 files from directory on server

Laravel Carbon throws error The format separator does not match

Refresh specific HTML content that retrieves data from MySQL

About Contact Privacy policy Terms and conditions