Organizational Research By

Surprising Reserch Topic

populate select box from database using jquery using -'php,jquery,mysql,populate'


populate select box from database using jquery  using -'php,jquery,mysql,populate'

I am trying to populate a select box from values from a mysql database, using jQuery.

db call:

<?php
include 'db.php';
$con = mysql_connect($host,$user,$pass);
$dbs = mysql_select_db($databaseName, $con);

$tableName = "tbl_title";
$result = mysql_query("SELECT * FROM $tableName");

$data = array();
while ( $row = mysql_fetch_row($result) )
{
    $data[] = $row;
}
//echo json_encode( $data );    
?>


HTML:

<select id="a1_title">
  <option>Default</option>
</select>


There are a bunch of examples that I have found, but nothing specifically related to what I am looking for, unless the force is not with me today.

Is there a link someone can point me to?
    
asked Sep 8, 2015 by rajesh
0 votes
21 views



Related Hot Questions



Government Jobs Opening


...