• 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

Sum array values of a column within each column of an array with 3 levels

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

Convert regular text to array using notepad++

Check if string contains a value in array [duplicate]

how to pass row id in href of a tag in codeigniter controller?

How to loop sql table data inside a html table

PHP usort() order in case of equality

How to send image,audio or video through the WhatsApp API - PHP

How to Install Composer Require doctrine/dbal

wordpress function breaks wp-admin

merging two arrays with specified index

How to fix Call to undefined method AppModelsTableName::factory?

Laravel Unknown Column 'updated_at'

SilverStripe unable to populate multiple member Childs

About Contact Privacy policy Terms and conditions