• 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

Generate random username based on full name php

Currently Using CodeIgniter Framework i have an Error

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

how to prevent float variables displaying as scientific notation when printing [duplicate]

PHP only Hit Counter?

ConstraintViolationListInterface to Exception in Symfony

PHP mail function is sending blank message body

How to access a var with "-" in PHP [duplicate]

how to get value from array in laravel

Dropzone: Submit both form data and dropzone at once

Form repeater send wrong data with last element in Laravel

How to get quarter for future date using Carbon?

Unable to get password for the instance created from AMI

Yii2 select2 database exception number of bound variables does not match number of tokens

About Contact Privacy policy Terms and conditions