• 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

java URL working on browser but not in client program

dompdf and img tag, image wont show

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

Get keys from associative array [duplicate]

Convert PHP array into HTML tag attributes separated by spaces

Input and output values for php into the browser?

php 7 php.ini upload_max_filesize not working

WordPress Security Standards want me to escape my html, but how to do it correctly?

Applying programmatically a coupon to an Order in WooCommerce3

Webscraping Symfony/Panther: Can't get HTML

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

Laravel - How to properly generate unique slugs from article titles?

Spam Filter in Contact Form

Add restriction to WooCommerce coupons by allowed user ID

JQuery content editable div and text box on submit not sending POST

About Contact Privacy policy Terms and conditions