Autocomplete MySql PHP
Autocomplete MySql PHP
aungkohein
Posts: 38Questions: 5Answers: 0
Hi!
Could you provide me with the syntax for loading autocomplete suggestion from MySQL table? Here is my example code and I could not understand how to convert it:
// The below is using local data variables. I do not want to hard code here but load from database.
var editor;
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: 'php/table.cars.php',
table: '#cargoes',
fields: [
{
"label": "Date:",
"name": "date",
"type": "datetime",
"format": "DD\/MM\/YY"
},
{
"label": "Status:",
"name": "status",
"type": "autoComplete",
"opts": {
"source":
[
"Open",
"Home",
"Parked",
]
}
},
This discussion has been closed.
Answers
Found the Solution!
Follow this video: https://www.youtube.com/watch?v=UBs6wKVSCmU
Step 1: Create a data.php
Hi @allan / @colin,
The above codes does not work!
Case: I would like to retrieve the values of Autocomplete from the database(MySQL) using PHP.
Iinline Editor jQuery UI Autocomplete
data.php -- This gives me json format "
Result: No AutoComplete suggestion shown in the Editor cell.
Can you link to your page please? Have you included the jQuery UI AutoComplete plug-in for Editor?
From the jQuery UI documentation that should be all you need I think.
Allan