• 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

Nginx disallowing execution of PHP in uploads directory with Magento

Submitting a form with ajax in Wordpress

How to map the two arrays with a duplicate value?

Custom post type single page not working

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

Laravel Mix Uncaught ReferenceError: $ is not defined

PHP: remove filename from path

Eloquent insert id with sequence next value

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

WHM Enabling mod_rewrite

How to set time with DateTime modify?

PHP web3 ERC20 token function call

How do I do HTTP basic authentication using Guzzle?

How to test a php login connected to a mysql db through xampp?

Composer Warning: openssl extension is missing. How to enable in WAMP

About Contact Privacy policy Terms and conditions