user1176151
user1176151

Reputation:

I need jquery UI auto complete source from mysql database

I create auto complete but its source coming from javascript, now i want to get source from mysql database using php language.Below is my script, Please help me

<SCRIPT language="javascript">

$(document).ready(function() {

$("input#autocomplete").autocomplete({

source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]

});

});       

</SCRIPT>

Upvotes: 0

Views: 545

Answers (2)

Oscar Jara
Oscar Jara

Reputation: 14187

Hope this helps, this is an example i made using php and mysql, you can download it from here:

http://dl.dropbox.com/u/15208254/trickylearning/examples/autocomplete/autocomplete-php.zip

Than main idea of this example is to have something with this structure in your db:

  • id: 1 / tag_column: jeans, jackets, shoes
  • id: 2 / tag_column: kfc, burger king, pizza hut

And the final result will split everything from db and look like this:

Final result of this example

Regards.

Upvotes: 1

run
run

Reputation: 1186

you can chage this <td width="249"><input type="text" name="name[]"/></td> to <td width="249"><input type="text" class="xyz" name="name[]"/></td> and in jquery use $(".xyz").autocomplete({});

Upvotes: 0

Related Questions