• 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

PDOException SQLSTATE[HY000] [2002] No such file or directory

Select option from dropdown menu with PHP and mySql

How to keep value of selected value after form submission?

How can I make good efficent AJAX live forms with just jQuery and

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

LARAVEL: How to fetch id dynamically in a query builder?

Call to a member function fetch_field() on a non-object MySQLiDB

generate an Excel file using PHP

Laravel/docker-compose/redis - Class 'Redis' not found

Prestashop webservice API creating cart rules

Unable to get password for the instance created from AMI

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

User pool client {id}does not exist

sort() not affecting original array while inside foreach loop

Dynamic dropdown Ajax PHP request

About Contact Privacy policy Terms and conditions