<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic I am going to give Dream in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124376#M77467</link>
    <description>&lt;P&gt;I am going to give Dream Factory a try, If not I will try the other options&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2016 14:23:14 GMT</pubDate>
    <dc:creator>Robert_C_6</dc:creator>
    <dc:date>2016-05-16T14:23:14Z</dc:date>
    <item>
      <title>How to connect my app to a mysql database</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124371#M77462</link>
      <description>&lt;P&gt;I want to connect my app to a mysql database to query and display information.&lt;/P&gt;

&lt;P&gt;Is that something that is possible with Intel XDK?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 18:46:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124371#M77462</guid>
      <dc:creator>Robert_C_6</dc:creator>
      <dc:date>2016-05-12T18:46:27Z</dc:date>
    </item>
    <item>
      <title>If you have a a mysql</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124372#M77463</link>
      <description>&lt;P&gt;If you have a a mysql database on a server, I recommend implementing REST API on the server to allow access to the database entries from the client. Intel XDK allows you to create the application. It doesn't contain a feature to implement this for you.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 23:04:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124372#M77463</guid>
      <dc:creator>Elroy_A_Intel</dc:creator>
      <dc:date>2016-05-12T23:04:07Z</dc:date>
    </item>
    <item>
      <title>Hi Robert,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124373#M77464</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi Robert,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I'm using Dreamfactory to access MySQL from XDK (www.dreamfactory.com). It is an opensource tool that generates automatically the REST API that Elroy is suggesting to implement just connecting your database. It works very well, handles autentication and has a lot of features more.&lt;/P&gt;

&lt;P&gt;Additional to MySQL, it works with several databases more, including some NoSQL, I think it worth take a look and dedicate some time to learn it and testing.&lt;/P&gt;

&lt;P&gt;Once you get the basics feel free to PM me for some sample code to use it from XDK.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2016 12:05:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124373#M77464</guid>
      <dc:creator>Diego_Calp</dc:creator>
      <dc:date>2016-05-13T12:05:50Z</dc:date>
    </item>
    <item>
      <title>Hi Robert</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124374#M77465</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi Robert&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I just create a web service on the mysql server. The web service can be php or asp.net and can return JSON data to your app.&lt;BR /&gt;
	&lt;BR /&gt;
	Please search my other postings for example code.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 11:27:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124374#M77465</guid>
      <dc:creator>Nick_F_2</dc:creator>
      <dc:date>2016-05-16T11:27:19Z</dc:date>
    </item>
    <item>
      <title>I personally use webservices</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124375#M77466</link>
      <description>&lt;P&gt;I personally use webservices to retrieve JSON datas from website.&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 12:30:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124375#M77466</guid>
      <dc:creator>Fab_V_</dc:creator>
      <dc:date>2016-05-16T12:30:37Z</dc:date>
    </item>
    <item>
      <title>I am going to give Dream</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124376#M77467</link>
      <description>&lt;P&gt;I am going to give Dream Factory a try, If not I will try the other options&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 14:23:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124376#M77467</guid>
      <dc:creator>Robert_C_6</dc:creator>
      <dc:date>2016-05-16T14:23:14Z</dc:date>
    </item>
    <item>
      <title>Hi Diego,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124377#M77468</link>
      <description>&lt;P&gt;Hi Diego,&lt;/P&gt;

&lt;P&gt;I am developing an app for taking photos and location and upload them in a database (propably in phpMyAdmin). I also started using dreamfactory. Can you provide me some help on connecting the database with the xdk?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:58:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124377#M77468</guid>
      <dc:creator>Kiriakos_T_</dc:creator>
      <dc:date>2017-04-25T13:58:02Z</dc:date>
    </item>
    <item>
      <title>You can just use pure PHP,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124378#M77469</link>
      <description>&lt;P&gt;You can just use pure PHP, doing everything inside an iframe, that you host on a free hosting service.&lt;/P&gt;

&lt;P&gt;This is the code you can use to connect to SQL&lt;/P&gt;

&lt;PRE class="brush:php;"&gt;&amp;lt;?php
$servername = "localhost";
$username = "username";
$password = "password";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn-&amp;gt;connect_error) {
    die("Connection failed: " . $conn-&amp;gt;connect_error);
} 
echo "Connected successfully";
?&amp;gt;&lt;/PRE&gt;

&lt;P&gt;If you want to execute a query, you must use a code like this one:&lt;/P&gt;

&lt;PRE class="brush:php;"&gt;$sql="Select * from Table_name";
$conn-&amp;gt;query($sql);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 16:14:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124378#M77469</guid>
      <dc:creator>Alex_Hang</dc:creator>
      <dc:date>2017-04-25T16:14:00Z</dc:date>
    </item>
    <item>
      <title>Hi Kiriakos,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124379#M77470</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi Kiriakos,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Here is some sample code, it is for DreamFactory 2 or above.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;//this function to connect, with a user defined in DF

function logindf(mail, pass){	
	$.ajax({
		type:'POST',
		beforeSend: function (request) {
			request.setRequestHeader('Content-Type','application/json');
			request.setRequestHeader('X-DreamFactory-Api-Key','YourAPIKEY');
		},
        //urldf is your DreamFactory URL
		url: urlDf+'api/v2/user/session',

		data: '{"email":"'+mail+'", "password":"'+pass+'"}',
		success: function (response) {
            //save session in a global variable to use in other DF calls
            sesion = response.session_id;
		},
		error: function (response) {

            alert('Se ha producido un error de acceso, por favor intente nuevamente');            
			console.log(JSON.stringify(response));
		}
	});	


//this is an example to get some data from a table
    $.ajax({
		type:'GET',
		beforeSend: function (request) {
			request.setRequestHeader('X-DreamFactory-Application-Name', service); //the service name you set in DF
			request.setRequestHeader('X-DreamFactory-Session-Token', sesion);	//the session from the login function
			request.setRequestHeader('X-DreamFactory-Api-Key','YourAPIKEY');
		},
		url: urlDf+'api/v2/'+service+'/_table/yourtable',//table name
		dataType: "json",
		success: function (data) { 
			var len = data.resource.length;
			for (var i = 0; i &amp;lt; len; i++) {
                //process the result
			}
		},
		error: function (response) {

			alert('Se ha producido un error al consultar la base de datos, por favor intente nuevamente');
			alert(JSON.stringify(response));
		}
	});&lt;/PRE&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 16:40:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124379#M77470</guid>
      <dc:creator>Diego_Calp</dc:creator>
      <dc:date>2017-04-25T16:40:00Z</dc:date>
    </item>
    <item>
      <title>Dream factory should be</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124380#M77471</link>
      <description>&lt;P&gt;Dream factory should be installed in the same host of the database in order to have access to the database, am I right? if it is installed in local copmuter it will not get the appropriate database, right?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 08:37:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124380#M77471</guid>
      <dc:creator>Kiriakos_T_</dc:creator>
      <dc:date>2017-04-27T08:37:32Z</dc:date>
    </item>
    <item>
      <title>Dreamfactory can connect to</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124381#M77472</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Dreamfactory can connect to remote databases, you may install it anywhere.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;Diego&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:13:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-connect-my-app-to-a-mysql-database/m-p/1124381#M77472</guid>
      <dc:creator>Diego_Calp</dc:creator>
      <dc:date>2017-04-27T13:13:16Z</dc:date>
    </item>
  </channel>
</rss>

