• 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

Getting values for an enum?

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

Alert message after submitting form in PHP

MySQL default time format UTC or GMT?

How to to send mail using gmail in Laravel?

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

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

Open a popup box after receiving result from ajax

How to insert data from multiple select dropdown values into database?

How to retrieve Active Directory group policy maximum password age using LDAP

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

Unable to guess the mime type as no guessers are available Laravel 5.2

Transform array, set each array element with parent key php

How do I set the maximum php memory limit

Change user role if checkout custom checkbox is checked in WooCommerce

About Contact Privacy policy Terms and conditions