Software Archive
Read-only legacy content
17061 Discussions

Retrieve Table Data from MySQL

Takura_T_
Beginner
418 Views

Hi Guys

I'm new to Intel XDK, I spent the whole day trying to access data from MySQL, just couldn't do it. Is there anyone who can help me with the steps to retrieving MySQL data?

TK

 

0 Kudos
1 Reply
Abel_G_
Beginner
418 Views

It depends on the programming language of your server, The Intel XDK library does not have direct interaction with the server, for example if you are using PHP in your server:

// file.php in your server

<?php
$conn = mysql_connect('localhost', 'user', 'password') or die('Could not connect: ' . mysql_error());
mysql_select_db('bd', $conn);
$sql = mysql_query("SELECT * from users");
echo json_encode($sql);
?>

and then in the XDK app:

intel.xdk.device.getRemoteData("http://yourserver.com/file.phpl", "GET","","success_handler","error_handler");

function success_handler (data) {  alert("success: " + data); }
function error_handler(data) {  alert("error: " + data); }

check this link: https://software.intel.com/es-es/node/493009

0 Kudos
Reply