0

Here I have an dataTable: http://jsbin.com/aMAQUWe/1/edit with code:

<html>
  <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {packages:['table']});
      google.setOnLoadCallback(drawTable);
      function drawTable() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Name');
        data.addColumn('number', 'Salary');
        data.addColumn('boolean', 'Full Time Employee');
        data.addColumn('number', 'Parcele ha');

        data.addRows([
          ['Mike',  {v: 10000, f: '$10,000'}, true, 1200],
          ['Jim',   {v:8000,   f: '$8,000'},  false, 344],
          ['Alice', {v: 12500, f: '$12,500'}, true, 888],
          ['Bob',   {v: 7000,  f: '$7,000'},  true,999]
        ]);

        var table = new google.visualization.Table(document.getElementById('table_div'));
        table.draw(data, {showRowNumber: true});
      }
    </script>
  </head>

  <body>
    <div style='background:#fff'; id='table_div'></div>
  </body>
</html>

On server side I have a mysql table: Employee and column: name, salary, time, parcele

How I can connect my DataTable with my mysql dataBase and to make it workable for CRUD functions (create,read,update,delete,search) ?

Is there any plugin or example, tutorial how I can make it?

sorry for my english, its bad, but I;m learning hard

MikiMrki
  • 185
  • 2
  • 6
  • 22

1 Answers1

2

Are you trying to connect to you DB directly from client? if so Read this link first.
As mentioned at the link its a bad practice.
The right way to do so is to connect to your DB from the server side (using: PHP ,Node.js, etc) and dynamically create the page with the data table you want.

Community
  • 1
  • 1
Roy
  • 221
  • 3
  • 8