Datatable with SQL database from Google SQL Cloud

Datatable with SQL database from Google SQL Cloud

haiviprealhaivipreal Posts: 4Questions: 1Answers: 0

I can do a datatable with Basic initialisation and deploy to Google Engine successfully but I can not set up a datatable with SQL database that store on Google Cloud SQL.
It's here:
http://minishellhaitran.appspot.com/ --> Error: Invalid JSON - but the sql file take from Datatable example - so I think it okie.
Debug: http://debug.datatables.net/izikey
Complete code: https://www.dropbox.com/s/doo3dr9ha3hhz71/minishell%20-%20Copy.rar?dl=0

I'm a newbabie on IT so I do not know how to adust the Javacript & PHP @ https://datatables.net/examples/server_side/simple.html to suiltable with Google SQL Cloud

I write the code like this:

Javacript:

$(document).ready(function() { $('#example').dataTable( { "processing": true, "serverSide": true, "ajax": "server_processing.php" } ); } );
  • PHP:
    $sql_details = array(
    'user' => '',
    'pass' => '',
    'db' => 'sqlserver.sql',
    'host' => '173.194.106.22'
    );

// DB table to use
$table = 'datatables_demo';

// Table's primary key
$primaryKey = 'id';

Please to advise me this case. It takes me nearly a month :( Thank much for your help.

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Error: Invalid JSON - but the sql file take from Datatable example - so I think it okie

    Click the "Tables" tab at the top and then the "Server interaction" option in the list below. You'll see what is being returned by the server. It is not valid JSON :-)

    Allan

  • haiviprealhaivipreal Posts: 4Questions: 1Answers: 0

    Tks much for your response. I've seen the debug and read the guide to check JSON file but I dont know how to solve.

    Could you please show me the link to the database- datatables_demo of this example: https://datatables.net/examples/server_side/simple.html for reference. Tks much. Have a nice day.

    Hai

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    It looks like your "server_processing.php" file is returning an HTML document. I don't know why it would do that if you are using my scripts from the download package. I would need to be able to log into the server to discover what is going wrong as there is something wrong with that script.

    I would suggest trying to use the server-side processing scripts included in the DataTables download package.

    Allan

  • haiviprealhaivipreal Posts: 4Questions: 1Answers: 0

    I've alo tried with ajax - array.txt - it's still not work with Google Apps Engine. In fact, I need to do a speed datatable of glossary - up to 800K words (rows) open for everyone but I dont want to show my data public via txt/html...(that I have done successfully with GAE) so I choose Serverside processing with sql file in Google SQL Cloud.

    But it's so difficult for a newbabie like me :( So please help to advise me how to go with or which sponsor I could do to get this task done. Tks much for any help. Hai vipreal.danang@gmail.com

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    edited October 2014

    800K rows. Yes - you would need to implement server-side processing in that case. If you need someone to do that, you might want to post a job request on ODesk.

    Allan

  • haiviprealhaivipreal Posts: 4Questions: 1Answers: 0

    Tks much for your adivse. Hai

This discussion has been closed.