使用UWP应用程序中的Php脚本从MySql服务器获取数据

Iam having a PHP script like

<?php
try{
$con= new PDO('mysql:host=iamhost;dbname=android_welcome', 'android_test', '**********') ;
$con->exec('SET NAMES utf8');
}  
 catch(Exeption $e){
  die('Error:'.$e->getMessage());
  }
  ?>

the above one is Connect.Php script, How can i connect to DB using this script and get executed my remaining scripts on Server and get JSON data to my UWP application.

I haven't installed any tools except Visual Studio Community 2015 Updt 2 on my PC, Should i have to install any other tools please guide me, Iam new to use MySQL Server and PHP scripts in UWP Applications.

Help me out.

If you want to get data in UWP - you should create REST API. You can do it with PHP. Try to search information about how to do it (it's much more then some lines of code).

There is also possibility to connect UWP directly to MySQL database with help of Connector/Net You can install it and add reference to MySql.Data.RT.dll

Here is a little snippet how to create table and add row:

using MySql.Data.MySqlClient;

........

using (MySqlConnection connection = new MySqlConnection("Database=as_bfb6f501597b777;Data Source=us-cdbr-azure-west-c.cloudapp.net;User Id=b74038821f5aea;Password=2564f4e5;SslMode=None;"))
{
connection.Open();

MySqlCommand createCommand = new MySqlCommand("CREATE TABLE demotable(salary int,surname varchar(255))", connection);

createCommand.ExecuteNonQuery();

MySqlCommand addCommand = new MySqlCommand("INSERT INTO demotable (salary,surname) VALUES (5000,'Smith')", connection);

addCommand.ExecuteNonQuery();
}