• 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

If you intend you use SMTP, add your SMTP Code after this Line

mysql_result is defined but mysql_free_result warns it expected a resource

I need to link Google Sheet with my Laravel

How To Access A Column In M-M Relationship Table In Laravel

PHP Deprecated issue when running artisan command

What is PHP's equivalent of JavaScript's "array.every()"?

PHP usort() order in case of equality

Is there a way to use Foundry Model for Authentification inside Functional Tests?

Pass an image through AJAX [duplicate]

Handle error for duplicate entries - PHP/MySQL

Coinpayments create_transaction "ERROR: Invalid command!"

Converting alphabet letter to alphabet position in PHP [duplicate]

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

Laravel Multi-language routes without prefix

How can I easily switch between PHP versions on Mac OSX?

About Contact Privacy policy Terms and conditions